/*!
\return \c true if the current user can remove this version of the object.
975638
function canVersionRemove( )
    {
        if ( !isset( $this->Permissions['can_versionremove'] ) )
        {
            $this->Permissions['can_versionremove'] = $this->checkAccess( 'versionremove' );
        }
        return ( $this->Permissions['can_versionremove'] == 1 );
    }
841085
public function canDelete($member = null)
    {
        if (!$member || !(is_a($member, 'Member')) || is_numeric($member)) {
            $member = Member::currentUser();
        }

        $results = $this->extend('canDelete', $member);

        if ($results && is_array($results)) {
            if (!min($results)) {
                return false;
            }
        }

        return $this->canEdit($member);
    }
792775
static function delete($from)
    {
        $from = self::makeVirtualDir($from, false);
        $result = false;
        if (is_file($from)){
            @unlink($from);
            $result = true;
        }
        self::deleteVirtualDir($from);
        return $result;
    }
753518
public function remove()
    {

        $origin = $destination = \Devil::getPathOf($this->config['dest']);
        if (isset($this->config['onload'])) {
            $destination .= '/origin';
        }
        $realFileName = $destination . '/' . $this->_primaryKey . '_' . $this->existing;
        if (file_exists($realFileName)) unlink($realFileName);

        if (isset($this->config['onload'])) foreach ($this->config['onload'] as $method=>$config) {
            $methodRemove = $method . 'Remove';
            $this->$methodRemove($origin, $this->_primaryKey . '_' . $this->existing, $config);
        }
    }
70964
public function isCascadeDeletesForceDeleting()
    {
        // Laravel 4.1 uses the softDelete property, and the only
        // indication that the delete should be forced is when
        // the softDelete property is set to false.
        if (property_exists($this, 'softDelete') && !class_exists(SoftDeletingScope::class)) {
            // @codeCoverageIgnoreStart
            return !$this->softDelete;
            // @codeCoverageIgnoreEnd
        }

        return property_exists($this, 'forceDeleting') && $this->forceDeleting;
    }
867180
function canMoveFrom( )
    {
        if ( !isset( $this->Permissions['can_move_from'] ) )
        {
            $this->Permissions['can_move_from'] = $this->checkAccess( 'edit' ) && $this->checkAccess( 'remove' );
        }
        return ( $this->Permissions['can_move_from'] == 1 );
    }
1366470
function canRemoveLocation()
    {
        if ( !isset( $this->Permissions['can_remove_location'] ) )
        {
            $this->Permissions['can_remove_location'] = $this->checkAccess( 'can_remove_location' );
        }
        return ( $this->Permissions['can_remove_location'] == 1 );
    }
576136
public function delete()
    {
        if (!$this->exists()) {
            return false;
        }
        if ($this->isDir()) {
            return rmdir($this->absoluteFileName);
        }

        return unlink($this->absoluteFileName);
    }
217674
public function remove()
    {
        if (!isset($this->_pkValue)) {
            return false;
        }
        if (self::delete($this->_pkValue) > 0) {
            $this->_pkValue = null;
            return true;
        }
        return false;
    }
19539
public function isVersioningNecessary($con = null)
    {
        if ($this->alreadyInSave) {
            return false;
        }

        if ($this->enforceVersion) {
            return true;
        }

        if (ChildDealerProductQuery::isVersioningEnabled() && ($this->isNew() || $this->isModified()) || $this->isDeleted()) {
            return true;
        }
        if (null !== ($object = $this->getDealer($con)) && $object->isVersioningNecessary($con)) {
            return true;
        }

        if (null !== ($object = $this->getProduct($con)) && $object->isVersioningNecessary($con)) {
            return true;
        }


        return false;
    }
738389
public function actionRemovePageVersion()
    {
        $pageId = Yii::$app->request->getBodyParam('pageId');
        
        $page = NavItemPage::findOne((int) $pageId);
        
        if ($page) {
            $page->forceNavItem->updateTimestamp();
            return $page->delete();
        }
        
        return false;
    }
1326533
function user_delete($p)
    {
        $this->load_engine();

        $p['abort'] = $p['abort'] || !$this->engine->delete_user_data($p['username']);

        return $p;
    }
1146886
private function getUserVersion($object)
    {
        if ($this->utils->getCurrentRequestMethod() == 'PATCH') {
            $content = json_decode($this->utils->getCurrentRequestContent(), true);

            $hasVersion = array_filter(
                $content,
                function ($val) {
                    if ($val['path'] == '/'.self::FIELD_NAME) {
                        return true;
                    }
                    return false;
                }
            );

            if (empty($hasVersion)) {
                return -1;
            }
        }

        return $this->getVersionFromObject($object);
    }
1332997
public static function remove() {
		if(self::$entity_manager == null)
			self::initialize();

		return call_user_func_array(array(self::$entity_manager, "remove"), func_get_args());
	}
548410
function revertFromTemporaryVersion()
    {
        $temporaryVersion = eZRole::fetch( 0, $this->attribute( 'id' ) );
        if ( $temporaryVersion === null )
            return 0;
        $this->removePolicies();
        $this->setAttribute( 'name', $temporaryVersion->attribute( 'name') );
        $this->setAttribute( 'is_new', 0 );

        $db = eZDB::instance();
        $db->begin();
        $this->store();

        $query = "UPDATE  ezpolicy
                  SET role_id = " . $this->attribute( 'id' ) . "
                  WHERE role_id = " . $temporaryVersion->attribute( 'id' );
        $db->query( $query );
        $temporaryVersion->removePolicies( false );
        $temporaryVersion->remove();
        $db->commit();

        // Expire role cache
        $handler = eZExpiryHandler::instance();
        $handler->setTimestamp( 'user-info-cache', time() );
        $handler->setTimestamp( 'user-class-cache', time() );
        $handler->store();
    }
1290835
public function isUserAllowedToDeleteOwnAccount()
    {
        $allowUsersToDeleteTheirAccount = Registry::getConfig()->getConfigParam('blAllowUsersToDeleteTheirAccount');

        $user = $this->getUser();

        return $allowUsersToDeleteTheirAccount && $user && !$user->isMallAdmin();
    }
752666
function removeThis( $id, $currentVersion = null )
    {
        $dataType = $this->dataType();
        if ( !$dataType )
            return false;
        $dataType->deleteStoredObjectAttribute( $this, $currentVersion );
        if( $currentVersion == null )
        {
            eZPersistentObject::removeObject( eZContentObjectAttribute::definition(),
                                              array( "id" => $id ) );
        }
        else
        {
            eZPersistentObject::removeObject( eZContentObjectAttribute::definition(),
                                              array( "id" => $id,
                                                     "version" => $currentVersion ) );
        }
    }