This commit is contained in:
parent
2f7d4cbca1
commit
f3488d17a0
@ -772,12 +772,6 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
|
||||
return $value;
|
||||
}
|
||||
|
||||
if (isset($this->_id[$lower])) {
|
||||
return $this->_id[$lower];
|
||||
}
|
||||
if ($name === $this->_table->getIdentifier()) {
|
||||
return null;
|
||||
}
|
||||
if (isset($this->_values[$lower])) {
|
||||
return $this->_values[$lower];
|
||||
}
|
||||
@ -793,8 +787,11 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
|
||||
return $this->_references[$name];
|
||||
|
||||
} catch(Doctrine_Table_Exception $e) {
|
||||
|
||||
throw new Doctrine_Record_Exception("Unknown property / related component '$name'.");
|
||||
foreach ($this->_table->getFilters() as $filter) {
|
||||
if (($value = $filter->filterGet($this, $name, $value)) !== null) {
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
@ -39,12 +39,12 @@ abstract class Doctrine_Record_Filter
|
||||
*
|
||||
* @param mixed $name name of the property or related component
|
||||
*/
|
||||
abstract public function filterSet($key, $value);
|
||||
abstract public function filterSet(Doctrine_Record $record, $name, $value);
|
||||
/**
|
||||
* filterGet
|
||||
* defines an implementation for filtering the get() method of Doctrine_Record
|
||||
*
|
||||
* @param mixed $name name of the property or related component
|
||||
*/
|
||||
abstract public function filterGet($key);
|
||||
abstract public function filterGet(Doctrine_Record $record, $name);
|
||||
}
|
||||
|
@ -39,9 +39,9 @@ class Doctrine_Record_Filter_Standard extends Doctrine_Record_Filter
|
||||
*
|
||||
* @param mixed $name name of the property or related component
|
||||
*/
|
||||
public function filterSet($key, $value)
|
||||
{
|
||||
throw new Doctrine_Record_Exception('Unknown record property / related component \'' . $key . '\'.');
|
||||
public function filterSet(Doctrine_Record $record, $name, $value)
|
||||
{
|
||||
throw new Doctrine_Record_Exception('Unknown record property / related component \'' . $name . '\'.');
|
||||
}
|
||||
/**
|
||||
* filterGet
|
||||
@ -49,8 +49,8 @@ class Doctrine_Record_Filter_Standard extends Doctrine_Record_Filter
|
||||
*
|
||||
* @param mixed $name name of the property or related component
|
||||
*/
|
||||
public function filterGet($key)
|
||||
public function filterGet(Doctrine_Record $record, $name)
|
||||
{
|
||||
throw new Doctrine_Record_Exception('Unknown record property / related component \'' . $key . '\'.');
|
||||
throw new Doctrine_Record_Exception('Unknown record property / related component \'' . $name . '\'.');
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user