Esempio n. 1
0
 /**
  * Magic getter
  *
  * @param   string  $name   Name of property that is accessed
  *
  * @return  mixed   Returns property value
  */
 public function __get($name)
 {
     switch ($name) {
         case 'settings':
             if (empty($this->_settings)) {
                 $this->_settings = new SettingsCollection('Scalr\\Model\\Entity\\FarmSetting', [['farmId' => &$this->id]], ['farmId' => &$this->id]);
             }
             return $this->_settings;
         case 'farmRoles':
             if (empty($this->_farmRoles)) {
                 $this->_farmRoles = FarmRole::findByFarmId($this->id);
             }
             return $this->_farmRoles;
         case 'servers':
             if (empty($this->_servers)) {
                 $this->_servers = Server::findByFarmId($this->id);
             }
             return $this->_servers;
         default:
             return parent::__get($name);
     }
 }