Horde_Rdo_Mapper::__get PHP Method

__get() public method

These properties are available: adapter: The Horde_Db_Adapter this mapper is using to talk to the database. factory: The Horde_Rdo_Factory instance, if present inflector: The Horde_Support_Inflector this Mapper uses to singularize and pluralize PHP class, database table, and database field/key names. table: The database table or view that this Mapper manages. tableDefinition: The Horde_Db_Adapter_Base_TableDefinition object describing the table or view this Mapper manages. fields: Array of all field names that are loaded up front (eager loading) from the table. lazyFields: Array of fields that are only loaded when accessed. relationships: Array of relationships to other Mappers. lazyRelationships: Array of relationships to other Mappers which are only loaded when accessed.
public __get ( string $key ) : mixed
$key string Property name to fetch
return mixed Value of $key
    public function __get($key)
    {
        switch ($key) {
            case 'inflector':
                $this->inflector = new Horde_Support_Inflector();
                return $this->inflector;
            case 'primaryKey':
                $this->primaryKey = (string) $this->tableDefinition->getPrimaryKey();
                return $this->primaryKey;
            case 'table':
                $this->table = !empty($this->_table) ? $this->_table : $this->mapperToTable();
                return $this->table;
            case 'tableDefinition':
                $this->tableDefinition = $this->adapter->table($this->table);
                return $this->tableDefinition;
            case 'fields':
                $this->fields = array_diff($this->tableDefinition->getColumnNames(), $this->_lazyFields);
                return $this->fields;
            case 'lazyFields':
            case 'relationships':
            case 'lazyRelationships':
            case 'factory':
            case 'defaultSort':
                return $this->{'_' . $key};
        }
        return null;
    }