add fulcrm_apiv2_url_to_type and fulcrm_apiv2_url_to_pk

master
Marek Isalski 8 years ago
parent 00c06fea92
commit 2604efa9c7

@ -44,6 +44,16 @@ function fulcrm_apiv2_prevent_loop( $headers ) {
return true;
}
function fulcrm_apiv2_url_to_type( $url ) {
preg_match( '/https:\/\/[^\/]+\/api\/v2\/([a-z_0-9]+)\/([0-9]+)?\//', $url, $matches );
return $matches[ 1 ];
}
function fulcrm_apiv2_url_to_pk( $url ) {
preg_match( '/https:\/\/[^\/]+\/api\/v2\/([a-z_0-9]+)\/([0-9]+)?\//', $url, $matches );
return intval( $matches[ 2 ] );
}
function fulcrm_apiv2_http( $method, $object = null, $data = null, $query = null ) {
$url = null;

Loading…
Cancel
Save