Doctrine_Record::delete PHP Метод

delete() публичный Метод

this event can be listened by the onPreDelete and onDelete listeners
public delete ( Doctrine_Connection $conn = null ) : boolean
$conn Doctrine_Connection
Результат boolean true if successful
    public function delete(Doctrine_Connection $conn = null)
    {
        if ($conn == null) {
            $conn = $this->_table->getConnection();
        }
        return $conn->unitOfWork->delete($this);
    }

Usage Example

 /**
  * Shift the eff/exp dates of this table so that it fits within its parent(s) (parent_eff <= child_eff < child_exp <= parent_exp)
  * @param $record Doctrine_Record
  * @return null
  */
 protected function limitParentDates(Doctrine_Record $child)
 {
     // loop through temporal relationships and make sure this date range is inside the parent's range
     foreach ($this->_options['parents'] as &$parent) {
         try {
             $parent_obj = $child->{$parent};
             // TODO causes $parent->_oldValues to be erased
             $child->setDatesWithinParent($parent_obj);
         } catch (Doctrine_Record_SavingNonsenseException $e) {
             $child->delete();
         }
     }
 }
All Usage Examples Of Doctrine_Record::delete