$this->invokeSaveHooks('pre', 'save');
public invokeSaveHooks ( string $when, string $type, Doctrine_Event $event = null ) : Doctrine_Event | ||
$when | string | 'post' or 'pre' |
$type | string | serialize, unserialize, save, delete, update, insert, validate, dqlSelect, dqlDelete, hydrate |
$event | Doctrine_Event | event raised |
return | Doctrine_Event | the event generated using the type, if not specified |
/** * Inserts a record into database. * * This method inserts a transient record in the database, and adds it * to the identity map of its correspondent table. It proxies to @see * processSingleInsert(), trigger insert hooks and validation of data * if required. * * @param Doctrine_Record $record * @return boolean false if record is not valid */ public function insert(Doctrine_Record $record) { $event = $record->invokeSaveHooks('pre', 'insert'); if ($record->isValid(false, false)) { $table = $record->getTable(); if (!$event->skipOperation) { if ($table->getOption('joinedParents')) { // just for bc! $this->_insertCTIRecord($table, $record); //-- } else { $this->processSingleInsert($record); } } $table->addRecord($record); $record->invokeSaveHooks('post', 'insert', $event); return true; } return false; }