Subversion Repositories PHPX

Compare Revisions

Last modification

Ignore whitespace Rev 54 → Rev 53

/trunk/Model.php
17,7 → 17,7
*
* @type Table|string
*/
protected static $_persistentTable;
protected $_persistentTable;
 
/**
* The name(s) of the property or properties whose value(s)
57,22 → 57,20
 
public function getPersistentTable ()
{
$class = \get_class($this);
if (\is_string($class::$_persistentTable))
if (is_string($this->_persistentTable))
{
/* Call setter to convert to Table */
$this->setPersistentTable($class::$_persistentTable);
$this->persistentTable = $this->_persistentTable;
}
 
return $class::$_persistentTable;
return $this->_persistentTable;
}
 
public function setPersistentTable ($value)
{
$class = \get_class($this);
if ($value instanceof Table)
{
$class::$_persistentTable = $value;
$this->_persistentTable = $value;
}
else
{
85,7 → 83,7
);
}
 
$class::$_persistentTable = $table;
$this->_persistentTable = $table;
}
}
 
132,7 → 130,6
*/
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);