public function delete(User $user)
    {
        $this->dispatcher->dispatch(UserEvents::BEFORE_DELETE, new UserEvent($user));

        $this->clearIdentityMap($user);

        $this->conn->executeUpdate('DELETE FROM ' . $this->conn->quoteIdentifier($this->userTableName). ' WHERE '.$this->getUserColumns('id').' = ?', array($user->getId()));
        $this->conn->executeUpdate('DELETE FROM ' . $this->conn->quoteIdentifier($this->userCustomFieldsTableName). ' WHERE '.$this->getUserColumns('user_id').' = ?', array($user->getId()));

        $this->dispatcher->dispatch(UserEvents::AFTER_DELETE, new UserEvent($user));
    }
public function delete(User $user)
    {
        $this->dispatcher->dispatch(UserEvents::BEFORE_DELETE, new UserEvent($user));

        $this->clearIdentityMap($user);

        $this->conn->executeUpdate('DELETE FROM ' . $this->conn->quoteIdentifier($this->userTableName). ' WHERE '.$this->getUserColumns('id').' = ?', array($user->getId()));
        $this->conn->executeUpdate('DELETE FROM ' . $this->conn->quoteIdentifier($this->userCustomFieldsTableName). ' WHERE '.$this->getUserColumns('user_id').' = ?', array($user->getId()));

        $this->dispatcher->dispatch(UserEvents::AFTER_DELETE, new UserEvent($user));
    }
public function delete ( User $ user ) { $ this -> dispatcher -> dispatch ( UserEvents :: BEFORE_DELETE , new UserEvent ( $ user ) ) ; $ this -> clearIdentityMap ( $ user ) ; $ this -> conn -> executeUpdate ( 'DELETE FROM ' . $ this -> conn -> quoteIdentifier ( $ this -> userTableName ) . ' WHERE ' . $ this -> getUserColumns ( 'id' ) . ' = ?' , array ( $ user -> getId ( ) ) ) ; $ this -> conn -> executeUpdate ( 'DELETE FROM ' . $ this -> conn -> quoteIdentifier ( $ this -> userCustomFieldsTableName ) . ' WHERE ' . $ this -> getUserColumns ( 'user_id' ) . ' = ?' , array ( $ user -> getId ( ) ) ) ; $ this -> dispatcher -> dispatch ( UserEvents :: AFTER_DELETE , new UserEvent ( $ user ) ) ; }
Delete a User from the database.

@param User $user
Delete a User from the database .