function __get($key) { if (method_exists($this, $key)) { return $this->{$key}(); } return parent::__get($key); }
public function __get($var) { if ($var == 'id') { return $this->getId(); } return parent::__get($var); }
public function __get($columnName) { try { return parent::__get($columnName); } catch (Exception $e) { return $this->_getRelation(ucfirst($columnName), true); } }
public function __get($name) { $rm = $this->_table->getReferenceMapData($name); if ($rm) { if (!isset($this->_externalRowData[$name])) { $tbl = new $rm["refTableClass"](); $extId = $this->_data[$rm["columns"]]; $select = $tbl->select()->where($rm["refColumns"] . ' = ?', $extId); $res = $tbl->fetchAll($select); if (count($res) > 0) { $res = $res[0]; $this->_externalRowData[$name] = $res; } } return $this->_externalRowData[$name]; } return parent::__get($name); }
/** * Retrieve row field value * Modified to also return related rowsets. * @param string $columnName The user-specified column name. * @return string The corresponding column value. * @throws Zend_Db_Table_Row_Exception if the $columnName is not a column in the row. */ public function __get($columnName) { try { $result = parent::__get($columnName); } catch (Zend_Db_Table_Row_Exception $e) { if (array_key_exists($columnName, $this->_related)) { $result = $this->_related[$columnName]; } elseif (array_key_exists($columnName, $this->_virtual)) { $result = $this->_virtual[$columnName]; } else { throw $e; } } return $result; }
public function get($name) { return parent::__get($name); }
/** * Overrides the magic get method to return foreign key attributes. This handles lazy * loading of the foreign key attributes. If the requested attribute is not a * foreign key attribute, just invokes the parent get method. * @param string $name The attribute to get. * @return mixed */ public function __get($name) { if ($this->hasForeignKey($name)) { if (!isset($this->_foreignObjects[$name])) { $this->_loadForeignObject($name); } return $this->_foreignObjects[$name]; } else { return parent::__get($name); } }