Scalr\Model\Entity\Farm::__get PHP Méthode

__get() public méthode

Gets the values of the properties that require initialization.
public __get ( string $name ) : mixed
$name string Name of property that is accessed
Résultat 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);
        }
    }