/**
  * @param $domainName
  * @return Domain proxy object
  */
 public function build($domainName)
 {
     $factory = new LazyLoadingValueHolderFactory();
     $initializer = function (&$wrappedObject, LazyLoadingInterface $proxy, $method, array $parameters, &$initializer) use($domainName) {
         $initializer = null;
         // disable further initialization
         $wrappedObject = new Domain($domainName);
         $result = $this->domainAPI->getInfo($wrappedObject);
         $wrappedObject->setAuthInfo($result['authinfo'])->setNameservers($result['nameservers'])->setAutorenew($result['autorenew']['active'])->setTld($result['tld'])->setStatus($result['status'])->setOwnerContact(new Contact($result['contacts']['owner']['handle']))->setAdminContact(new Contact($result['contacts']['admin']['handle']))->setBillContact(new Contact($result['contacts']['bill']['handle']))->setTechContact(new Contact($result['contacts']['tech']['handle']))->setResellerContact(new Contact($result['contacts']['reseller']['handle']))->setCreated(new \DateTime($result['date_registry_creation']))->setUpdated(new \DateTime($result['date_updated']))->setExpire(new \DateTime($result['date_registry_end']));
         $wrappedObject->setLock(false);
         foreach ($result['status'] as $status) {
             if ('clientTransferProhibited' == $status) {
                 $wrappedObject->setLock(true);
             }
         }
         return true;
         // confirm that initialization occurred correctly
     };
     return $factory->createProxy('EdsiTech\\GandiBundle\\Model\\Domain', $initializer);
 }
 /**
  * @param Domain $domain
  * @return bool
  */
 public function enableAutorenew(Domain $domain)
 {
     return $this->api->enableAutorenew($domain);
 }