Skip to content

Instantly share code, notes, and snippets.

@miguelramos
Last active August 29, 2015 14:00
Show Gist options
  • Save miguelramos/11396865 to your computer and use it in GitHub Desktop.
Save miguelramos/11396865 to your computer and use it in GitHub Desktop.
False is always True
$response = false;
$uri = preg_replace('/({\w+})/i', $entity, $this->getRoutes()->object_field_new->uri);
$rs = $this->rest->post($uri, array('field'=>array(
'name' => 'resource',
'required' => true,
'searchable' => false,
'type' => 4
)));
if(array_key_exists('status', $rs) and $rs['status'] == 201) {
$response = $rs['body'];
}
return $response;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment