Remove entity.

@todo проверку зависимостей от нод и папок.
554597
public function remove(Folder $entity)
    {
        $this->em->remove($entity);
        $this->em->flush();
    }
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);
        }
    }
1168383
public function delete(Entity $entity)
    {
        $endPointUrl = $this->getEndPointUrl(get_class($entity));

        if (method_exists($entity, 'endPointUrlArg')) {
            $endPointUrl.= '/'.$entity->endPointUrlArg();
        }

        return $this->curlDelete($endPointUrl);
    }
316265
public function delete($entity)
    {
        $query = $this->db->table($entity->definition()->getName());
        $primary = $entity->id();
        if (isset($this->objects[$entity->definition()->getName()][base64_encode(serialize($primary))])) {
            foreach ($primary as $k => $v) {
                $query->filter($k, $v);
            }
            $query->delete();
            unset($this->objects[$entity->definition()->getName()][base64_encode(serialize($primary))]);
        }
    }
397540
def destroy(self, request, *args, **kwargs):
        
        obj = self.get_object()
        user = request.user

        if strtobool(request.query_params.get('delete_content', 'false')):
            for entity in obj.entity_set.all():
                if user.has_perm('edit_entity', entity):
                    entity.delete()

            for data in obj.data.all():
                if user.has_perm('edit_data', data):
                    data.delete()

        return super().destroy(request, *args, **kwargs)
1088816
public function editAction($id = null)
    {
        if ($this->getRequest()->query->get('trash')) {
            /** @var Container $container */
            $container = $this->getContainer();

            /** @var EntityManager $em */
            $em = $container->get('doctrine')->getManager();

            $filters = $em->getFilters();

            // Разрешаем просмотр удалённых элементов
            if ($filters->isEnabled('softdeleteable')) {
                $filters->disable('softdeleteable');
            }
        }

        return parent::editAction($id);
    }
426360
public function removeAll()
    {
        $pdo = $this->entityManager->getConnection()->getWrappedConnection();
        $pdo->beginTransaction();

        try {

            $pdo->exec('SET FOREIGN_KEY_CHECKS=0');
            $pdo->exec('TRUNCATE role_permission');
            $pdo->exec('TRUNCATE role_hierarchy');
            $pdo->exec('TRUNCATE role');
            $pdo->exec('TRUNCATE permission');
            $pdo->exec('TRUNCATE user_role');
            $pdo->exec('SET FOREIGN_KEY_CHECKS=1');

            $pdo->commit();

        } catch (\Exception $e) {
            $pdo->rollBack();
            throw new DatabaseException($e->getMessage());
        }
    }
922616
def delete_entity(self, etype, entity_id):
        
        r = fapi.delete_entity(self.namespace, self.name, etype,
                                  entity_id, self.api_url)
        fapi._check_response_code(r, 202)
372392
public function remove($entity)
    {
        $entity->setState(0);
        $this->em->persist($entity);
        $this->em->flush();
    }
314425
public function delete($id)
    {
        $entity = $this->get($id);

        $this->manager->remove($entity);
        $this->manager->flush();
    }
691274
public function delete()
    {
        //usuwanie utworzonych widgetów
        (new CmsCategoryWidgetCategoryQuery)
            ->whereCmsCategoryWidgetId()->equals($this->getPk())
            ->find()
            ->delete();
        //usuwanie widgeta
        return parent::delete();
    }
1092905
@Override
    public T remove(T entity) {
        EntityManager entityManager = getEntityManager();
        if (entityManager.contains(entity)) {
            entityManager.remove(entity);
        } else {
            entityManager.remove(entityManager.merge(entity));
        }
        return entity;
    }
737894
public function delete()
    {
        $memoryTableAnnotation = ModelManager::getAnnotation($this, MemoryTable::class);
        if(null === $memoryTableAnnotation)
        {
            return null;
        }
        MemoryTableManager::del($memoryTableAnnotation->name, $this->__key);
    }
799684
public function removeAll()
    {
        $classMetaData = $this->entityManager->getClassMetadata($this->getEntityClassName());
        $connection = $this->entityManager->getConnection();
        $databasePlatform = $connection->getDatabasePlatform();
        $truncateTableQuery = $databasePlatform->getTruncateTableSql($classMetaData->getTableName());
        $connection->executeUpdate($truncateTableQuery);
    }
131244
protected function doDelete($entityId)
    {
        $entity = $this->find($entityId);

        if (method_exists($entity, 'setDeleted')) {
            $entity->setDeleted(true);
            $this->save($entity);

            return true;
        }

        $this->getEntityManager()->remove($entity);
        $this->getEntityManager()->flush($entity);

        return true;
    }
24434
public function delete()
    {
        // Validate form
        $form = $this->getForm('Delete' . $this->getEntityName());
        if (!$form->isValid()) {
            $this->addMessage($form->getMessages(), FlashMessenger::NAMESPACE_ERROR);
            return false;
        }

        // Remove account entity
        $entity = $form->getData();
        $this->getEntityManager()->remove($entity);

        // Trigger ondelete
        $this->onDelete($entity);

        // Save
        return $this->save($this->getEntityName() . ' deleted.', 'Unable to delete ' . strtolower($this->getEntityName()) . '.');
    }
270992
public function deleteAction() {
        try {
            if(sizeOf($this->dispatcher->getParams()) == 0) {
                throw new Exception('Invalid Entity Id Passed In', 400);
            }
            $entity = $this->validateEntityId($this->dispatcher->getParam(0));
            $this->deleteActionInternal($entity);
        } catch(Exception $e) {
            $this->handleError($e);
        } catch(ValidationException $e) {
            $this->handleValidationError($e);
        } catch(AclException $e) {
            $this->handleAclError($e);
        }
    }