/** * @param Contact $contact * @return bool * @throws APIException * @throws \Exception */ public function persist(Contact $contact) { $data = $contact->toGandiArray(); if ($contact->isNew()) { $response = $this->gandi->create($this->api_key, $data); if (is_array($response)) { return $response['handle']; } else { throw new APIException("Cannot create contact."); } } else { $handle = $contact->getHandle(); $response = $this->gandi->update($this->api_key, $handle, $data); if (is_array($response)) { return true; } else { throw new \Exception("Cannot update contact."); } } }
public function __call($method, $args) { if ($method == 'methodSignature') { return 'signatures not supported'; } return parent::__call($method, $args); }
/** * Call system.listMethods() * * @param array $method * @return array array(method, method, method...) */ public function listMethods() { return $this->_system->listMethods(); }
/** * @param Operation $operation * @param array|null $options * @return mixed */ public function restart(Operation $operation, array $options = null) { return $this->gandi->relaunch($this->api_key, $operation->getId(), $options); }
/** * @param array|null $options * @return mixed */ public function list(array $options = null) { $result = $this->gandi->list($this->api_key, $options); return $result; }