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:----mHOe3MvMBrd2ixRVc7SN564BvnPEBfl3PgSvfyyLIPaecdPmRqnYDE3W7ieBJk7weLENEkjIb5AuFVOD37AX5C9fURrAp/oBfijOZZMe2ATgnqMOk4sBlIkMO/uv0WKhofjoFlpk+zColKV2FJMcmXqpEdoOhD1c2FkJUvjt6FCAuaJUXNgfEd/SjhTQiyroHm/7C30wVZj2Xv5uwec+blziCCdi/bW0SD8kN7BNB8o5+vZxfzaeIY6kCQYNVkDRKnngW3oAVB/yZ+HkzLW7kv8vAnCR4WaIGi+XIuxXdtzZHSRGKyehdnmJywvS4F0rzt4Y9+NxvgWAiJG6QGAx36ucvekOMXz3WdyztCoT7Kd2n5yW2INImQjwDWhS1+ai33EMBULoTPo6IUIDfVEPyBHh6ma3Vhu6JdRmNLcZ2m7IkkfHCBvP8aQFxjyl7YylJqIlLgjBXafMRN92fKl1xu5Z3fqBVa+Nq7Jk1fAoCujAeGhN0k+0k1DD6E0NSwxd6VF+GH5JGqj4bYBI/WS83Lf0z3MLy1rsmlk/4SUzJAx+zhtjgLrHHgIJfL7GFQzOzLGsaJh9AEiIqApt3JP83jFozBiWD0jJMAeZV6YfFV/ni/p7fW8O4eOuTub/GxH5FfqVVSLNrDoFkQLB2O0bXaGTsn4yaFqc8NB1jurtlJs=----ATTACHMENT:----ODMxODY0Njk0MzYyODgzNyA1MTAxNTM4Njc5OTMwNDAxIDk2MzM1MTk5ODEzODgwNzQ=