}
/**
- *
+ * @return string
*/
public function __toString() {
return json_encode($this->lastResult);
}
/**
- *
+ * Perform action
*/
public function __call($action, $params) {
// @TODO Check if it's a valid action.
}
/**
- *
+ * Call via rest
+ * @return stdClass
*/
function remoteCall($entity, $action, $params = array()) {
$fields = "key={$this->key}&api_key={$this->api_key}";
/**
* Return the last error message.
+ * @return string
*/
function errorMsg() {
return $this->lastResult->error_message;
}
/**
- *
+ * Initialize
*/
function init() {
CRM_Core_DAO::init($this->cfg->dsn);
}
/**
- *
+ * @return $this
*/
public function attr($name, $value = NULL) {
if ($value === NULL) {
}
/**
- *
+ * @return bool
*/
public function is_error() {
return (property_exists($this->lastResult, 'is_error') && $this->lastResult->is_error);
}
/**
- *
+ * @param string $name
+ * @return bool
*/
public function is_set($name) {
return (isset($this->lastResult->$name));
}
/**
- *
+ * @return $this
*/
public function __get($name) {
// @TODO Test if valid entity.
/**
* Or use $api->value.
+ * @return array
*/
public function values() {
if (is_array($this->lastResult)) {
/**
* Or use $api->result.
+ * @return array
*/
public function result() {
return $this->lastResult;