protected function load()
 {
     if (!parent::load()) {
         $this->entityIdentifier = 'id';
         $this->entityUniqueKeys = array('name');
     }
 }
 /**
  * Constructor to initialize the YamlRepository with source
  * file config/DomainRepository.yml.
  */
 public function __construct()
 {
     parent::__construct(\Env::get('cx')->getWebsiteConfigPath() . '/DomainRepository.yml');
     //Initialize the Hostname Domain
     $hostName = new \Cx\Core\Net\Model\Entity\Domain($_SERVER['SERVER_NAME']);
     $hostName->setVirtual(true);
     //attach the hostname domain entity to repository
     $this->add($hostName);
     // set ID to 0 to make it having the same ID constantly
     $hostName->setId(0);
 }
 /**
  * Constructor
  */
 public function __construct()
 {
     $cx = \Cx\Core\Core\Controller\Cx::instanciate();
     $folderPath = $cx->getWebsiteTempPath() . '/Update';
     if (!file_exists($folderPath)) {
         \Cx\Lib\FileSystem\FileSystem::make_folder($folderPath);
     }
     if (!file_exists($folderPath . '/' . self::PENDING_DB_UPDATES_YML)) {
         \Cx\Lib\FileSystem\FileSystem::copy_file($cx->getCodeBaseCoreModulePath() . '/Update/Data/' . self::PENDING_DB_UPDATES_YML, $folderPath . '/' . self::PENDING_DB_UPDATES_YML);
     }
     parent::__construct($folderPath . '/' . self::PENDING_DB_UPDATES_YML);
 }
 /**
  * Constructor to initialize the YamlRepository with source
  * file config/DomainRepository.yml.
  */
 public function __construct()
 {
     parent::__construct(\Env::get('cx')->getWebsiteConfigPath() . '/DomainRepository.yml');
     //Initialize the Hostname Domain
     $hostName = $this->findOneBy(array('name' => $_SERVER['SERVER_NAME']));
     if (!$hostName) {
         $hostName = new \Cx\Core\Net\Model\Entity\Domain($_SERVER['SERVER_NAME']);
         $hostName->setVirtual(true);
         //attach the hostname domain entity to repository
         $this->add($hostName);
     } else {
         throw new \Exception('Duplicate entry for this domain, see http://bugs.cloudrexx.com/cloudrexx/ticket/2763');
     }
     $hostName->setVirtual(true);
     // set ID to 0 to make it having the same ID constantly
     $hostName->setId(0);
 }