1
0
mirror of synced 2024-12-13 22:56:04 +03:00
This commit is contained in:
zYne 2007-06-07 17:58:41 +00:00
parent a00c6061ab
commit 7bacdf0721

View File

@ -45,7 +45,69 @@ class Doctrine_AuditLog
{ {
$this->_table = $table; $this->_table = $table;
} }
/**
* __get
* an alias for getOption
*
* @param string $option
*/
public function __get($option)
{
if (isset($this->options[$option])) {
return $this->options[$option];
}
return null;
}
/**
* __isset
*
* @param string $option
*/
public function __isset($option)
{
return isset($this->options[$option]);
}
/**
* getOptions
* returns all options of this table and the associated values
*
* @return array all options and their values
*/
public function getOptions()
{
return $this->options;
}
/**
* setOption
* sets an option and returns this object in order to
* allow flexible method chaining
*
* @see slef::$_options for available options
* @param string $name the name of the option to set
* @param mixed $value the value of the option
* @return Doctrine_AuditLog this object
*/
public function setOption($name, $value)
{
if ( ! isset($this->_options[$name])) {
throw new Doctrine_Exception('Unknown option ' . $name);
}
$this->options[$name] = $value;
}
/**
* getOption
* returns the value of given option
*
* @param string $name the name of the option
* @return mixed the value of given option
*/
public function getOption($name)
{
if (isset($this->options[$name])) {
return $this->options[$name];
}
return null;
}
public function audit() public function audit()
{ {
$conn = $this->_table->getConnection(); $conn = $this->_table->getConnection();