propel/generated-classes/Base/User.php
/**
     * Removes this object from datastore and sets delete attribute.
     *
     * @param      ConnectionInterface $con
     * @return void
     * @throws PropelException
     * @see User::setDeleted()
     * @see User::isDeleted()
     */
Removes this object from datastore and sets delete attribute.
Removes this object from datastore and sets delete attribute .
public function delete(ConnectionInterface $con = null)
    {
        if ($this->isDeleted()) {
            throw new PropelException("This object has already been deleted.");
        }
        if ($con === null) {
            $con = Propel::getServiceContainer()->getWriteConnection(UserTableMap::DATABASE_NAME);
        }
        $con->beginTransaction();
        try {
            $deleteQuery = ChildUserQuery::create()
                ->filterByPrimaryKey($this->getPrimaryKey());
            $ret = $this->preDelete($con);
            if ($ret) {
                $deleteQuery->delete($con);
                $this->postDelete($con);
                $con->commit();
                $this->setDeleted(true);
            } else {
                $con->commit();
            }
        } catch (Exception $e) {
            $con->rollBack();
            throw $e;
        }
    }
public function delete ( ConnectionInterface $ con = null ) { if ( $ this -> isDeleted ( ) ) { throw new PropelException ( " This object has already been deleted. " ) ; } if ( $ con === null ) { $ con = Propel :: getServiceContainer ( ) -> getWriteConnection ( UserTableMap :: DATABASE_NAME ) ; } $ con -> beginTransaction ( ) ; try { $ deleteQuery = ChildUserQuery :: create ( ) -> filterByPrimaryKey ( $ this -> getPrimaryKey ( ) ) ; $ ret = $ this -> preDelete ( $ con ) ; if ( $ ret ) { $ deleteQuery -> delete ( $ con ) ; $ this -> postDelete ( $ con ) ; $ con -> commit ( ) ; $ this -> setDeleted ( true ) ; } else { $ con -> commit ( ) ; } } catch ( Exception $ e ) { $ con -> rollBack ( ) ; throw $ e ; } }
Removes this object from datastore and sets delete attribute.
Removes this object from datastore and sets delete attribute .