From 7bacdf072132ab45f32b741d1190984805bf1d47 Mon Sep 17 00:00:00 2001 From: zYne Date: Thu, 7 Jun 2007 17:58:41 +0000 Subject: [PATCH] --- lib/Doctrine/AuditLog.php | 64 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/AuditLog.php b/lib/Doctrine/AuditLog.php index 1f4083407..72d086c46 100644 --- a/lib/Doctrine/AuditLog.php +++ b/lib/Doctrine/AuditLog.php @@ -45,7 +45,69 @@ class Doctrine_AuditLog { $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() { $conn = $this->_table->getConnection();