Subversion Repositories PHPX

Compare Revisions

Last modification

Ignore whitespace Rev 53 → Rev 54

/trunk/Model.php
17,7 → 17,7
*
* @type Table|string
*/
protected $_persistentTable;
protected static $_persistentTable;
 
/**
* The name(s) of the property or properties whose value(s)
57,20 → 57,22
 
public function getPersistentTable ()
{
if (is_string($this->_persistentTable))
$class = \get_class($this);
if (\is_string($class::$_persistentTable))
{
/* Call setter to convert to Table */
$this->persistentTable = $this->_persistentTable;
$this->setPersistentTable($class::$_persistentTable);
}
 
return $this->_persistentTable;
return $class::$_persistentTable;
}
 
public function setPersistentTable ($value)
{
$class = \get_class($this);
if ($value instanceof Table)
{
$this->_persistentTable = $value;
$class::$_persistentTable = $value;
}
else
{
83,7 → 85,7
);
}
 
$this->_persistentTable = $table;
$class::$_persistentTable = $table;
}
}
 
130,6 → 132,7
*/
public function find ()
{
$class = \get_class($this);
$result = $this->persistentTable->find($this->{$this->_persistentId});
if ($result)
{
/trunk/AbstractModel.php
48,10 → 48,10
public function __get ($name)
{
/* Support for Object-Relational Mappers */
// if (strpos($name, 'persistent') === 0)
// if (strpos($name, 'persistent') === 0)
// {
// $class = get_class($this);
// return $class::${$name};
// $class = get_class($this);
// return $class::${"_" . $name};
// }
 
$method = 'get' . ucfirst($name);