Source for file Event.php
Documentation is available at Event.php
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @category Object Relational Mapping
* @link www.phpdoctrine.com
const STMT_FETCHALL =
12;
const SAVEPOINT_CREATE =
34;
const SAVEPOINT_ROLLBACK =
35;
const SAVEPOINT_COMMIT =
36;
const RECORD_DELETE =
21;
const RECORD_UPDATE =
23;
const RECORD_INSERT =
24;
const RECORD_SERIALIZE =
25;
const RECORD_UNSERIALIZE =
26;
* @var mixed $_invoker the handler which invoked this event
* @var string $_query the sql query associated with this event (if any)
* @var string $_params the parameters associated with the query (if any)
* @see Doctrine_Event constants
* @var integer $_code the event code
* @var integer $_startedMicrotime the time point in which this event was started
* @var integer $_endedMicrotime the time point in which this event was ended
* @var array $_options an array of options
* @param Doctrine_Connection|Doctrine_Connection_Statement|
Doctrine_Connection_UnitOfWork|Doctrine_Transaction $invoker the handler which invoked this event
* @param integer $code the event code
* @param string $query the sql query associated with this event (if any)
public function __construct($invoker, $code, $query =
null, $params =
array())
* @return string returns the query associated with this event (if any)
* returns the name of this event
* @return string the name of this event
case self::STMT_FETCHALL:
case self::SAVEPOINT_CREATE:
return 'create savepoint';
case self::SAVEPOINT_ROLLBACK:
return 'rollback savepoint';
case self::SAVEPOINT_COMMIT:
return 'commit Ssavepoint';
case self::RECORD_DELETE:
case self::RECORD_UPDATE:
case self::RECORD_INSERT:
case self::RECORD_SERIALIZE:
return 'serialize record';
case self::RECORD_UNSERIALIZE:
return 'unserialize record';
* @return integer returns the code associated with this event
* returns the value of an option
* @param string $option the name of the option
public function __get($option)
if ( ! isset
($this->_options[$option])) {
* skips the next operation
* an alias for __set('skipOperation', true)
* @return Doctrine_Event this object
$this->_options['skipOperation'] =
true;
* sets the value of an option
* @param string $option the name of the option
* @param mixed $value the value of the given option
* @return Doctrine_Event this object
public function __set($option, $value)
* starts the internal timer of this event
* @return Doctrine_Event this object
* whether or not this event has ended
* ends the internal timer of this event
* @return Doctrine_Event this object
* returns the handler that invoked this event
* @return Doctrine_Connection|Doctrine_Connection_Statement|
* Doctrine_Connection_UnitOfWork|Doctrine_Transaction the handler that invoked this event
* returns the parameters of the query
* @return array parameters of the query
* Get the elapsed time (in microseconds) that the event ran. If the event has
* not yet ended, return false.