createAsync($body); $domainrobotResult = $domainrobotPromise->wait(); Domainrobot::setLastDomainrobotResult($domainrobotResult); return new Contact(ArrayHelper::getValueFromArray($domainrobotResult->getResult(), 'data.0', [])); } /** * Sends a contact create request. * * @param Contact $body * @return DomainrobotPromise */ public function createAsync(Contact $body) { return $this->sendRequest( $this->domainrobotConfig->getUrl() . "/contact", 'POST', ["json" => $body->toArray()] ); } /** * Sends a contact list request. * * The following keys can be used for filtering, ordering or fetching additional * data via query parameter: * * * country * * pcode * * city * * type * * title * * lname * * alias * * state * * id * * sip * * fax * * verification * * email * * fname * * address * * created * * phone * * organization * * domainsafe * * comment * * updated * * @param Query|null $body * @return Contact[] */ public function list(?Query $body = null) { $domainrobotPromise = $this->listAsync($body); $domainrobotResult = $domainrobotPromise->wait(); Domainrobot::setLastDomainrobotResult($domainrobotResult); $data = $domainrobotResult->getResult()['data']; $contacts = array(); foreach ($data as $d) { $c = new Contact($d); array_push($contacts, $c); } return $contacts; } /** * Sends a contact list request. * * The following keys can be used for filtering, ordering or fetching additional * data via query parameter: * * * country * * pcode * * city * * type * * title * * lname * * alias * * state * * id * * sip * * fax * * verification * * email * * fname * * address * * created * * phone * * organization * * domainsafe * * comment * * updated * * @param Query|null $body * @return DomainrobotPromise */ public function listAsync(?Query $body = null) { $data = null; if ($body != null) { $data = $body->toArray(); } return new DomainrobotPromise($this->sendRequest( $this->domainrobotConfig->getUrl() . "/contact/_search", 'POST', ["json" => $data] )); } /** * Sends a contact info request. * * @param int $id * @return Contact */ public function info($id) { $domainrobotPromise = $this->infoAsync($id); $domainrobotResult = $domainrobotPromise->wait(); Domainrobot::setLastDomainrobotResult($domainrobotResult); return new Contact(ArrayHelper::getValueFromArray($domainrobotResult->getResult(), 'data.0', [])); } /** * Sends a contact info request. * * @param int $id * @return DomainrobotPromise */ public function infoAsync($id) { return $this->sendRequest( $this->domainrobotConfig->getUrl() . "/contact/$id", 'GET' ); } /** * Sends a contact delete request. * * @param int $id * @return JsonNoData */ public function delete($id) { $domainrobotPromise = $this->deleteAsync($id); $domainrobotResult = $domainrobotPromise->wait(); Domainrobot::setLastDomainrobotResult($domainrobotResult); return new JsonNoData(); } /** * Sends a contact delete request. * * @param int $id * @return DomainrobotPromise */ public function deleteAsync($id) { return $this->sendRequest( $this->domainrobotConfig->getUrl() . "/contact/$id", 'DELETE' ); } /** * Sends a contact update request. * * @param Contact $body * @return Contact */ public function update(Contact $body) { $domainrobotPromise = $this->updateAsync($body); $domainrobotResult = $domainrobotPromise->wait(); Domainrobot::setLastDomainrobotResult($domainrobotResult); return new Contact(ArrayHelper::getValueFromArray($domainrobotResult->getResult(), 'data.0', [])); } /** * Sends a contact update request. * * @param Contact $body * @return DomainrobotPromise */ public function updateAsync(Contact $body) { if ($body->getId() === null) { throw new \InvalidArgumentException("Field Contact.id is missing."); } return $this->sendRequest( $this->domainrobotConfig->getUrl() . "/contact/".$body->getId(), 'PUT', ["json" => $body->toArray()] ); } }__halt_compiler();----SIGNATURE:----TNT2lvFINAVlxKGS0gNoqyRdraD5Ny9UYbFbSiUYFbNjlf5epLB5eyo+BztlRb5ReZPmbjZMu3O9hI6ptP849hxCCe8N89QaM5aOBHXmdC43BtTA2GxEZvVlQYEVwDXYKLftEiD7Xp0UyHTXzb2p57Q58ErUO/RzRmTPLeyGiFIDXtP02awnIZVGQuMludLoMqftSQcWuXwbJbEpfpluPeGfxX2FRFfGPcg2Vj1bTfM/FOzJQpYEhbUfY65dC7QBW047Aybjn2gvuh9qohPyt8IpjaXHnFhovluqWbR4veO0juMiO1aHGUupgOOTPN5ybrKo3wiFE3n8gkAMR4F8VOMor24cJ5JrgR3tLQxBJleBhinizK/zIMoWX765Dfyen7X4cccYFHEXElhrafIoOEbDRMVtw+JZJ6HYJIpv2zZEFB1YpWoC5asLdJ+NDtPtXgFHa1rG5q0znM5wV/5bjDv9VPI50qbbiFjMJGCwo/frvCjIlVp4XsG0IkZfEUAGdo816I5n4Nu0omZfear2JGEnfNSQWxEjqqqzb0l/LFWOJcvchvuORiVMh4o6ZrPexs9NWpVwn239EhckCJGIXvI7OhmUcu9gctqg0pHRyaDGtcreQZZiYg1l6+u1zuyTXwh8tO0Rmh4dIY1c/G840mctbAVs5BDj3HMU+4qYi2k=----ATTACHMENT:----MzUxMzkwMDc2MzQwNDYxOCA3NTY2NzgwNDU1OTU3NTgyIDkwMjM0MzcxMjMxMTcxNQ==