Удаляет пользовательские поля у объекта
@param $entityId
@param array $fields
@throws \Sprint\Migration\Exceptions\HelperException
544312
public function deleteUserTypeEntitiesIfExists($entityId, array $fields) {
        foreach ($fields as $fieldName) {
            $this->deleteUserTypeEntityIfExists($entityId, $fieldName);
        }
    }
651320
public function addEntityWithId($entityId)
    {
        $entity = $this->getRepository()->get($entityId);
        if (!$entity) {
            throw new EntityNotFoundException(
                "The entity with is '{$entityId}' was not found."
            );
        }
        return $this->addEntity($entity);
        
    }
408861
public function deleteBatch(EntityInterface $entity)
    {
        if (is_null($this->deleteBatch)) {
            $this->deleteBatch = WriteRequestBatch::factory($this->dynamoDb);
        }
        $this->deleteBatch->add(new DeleteRequest($this->formatKeyCondition($entity), $this->getEntityTable($entity)));
    }
379410
public function edit($entityId)
    {
        $entity = $this->show($entityId);
        $form = $this->getForm();
        $this->set(compact('form'));
        
        if (!$entity instanceof EntityInterface) {
            return;
        }

        $form->setData($entity->asArray());
        
        if (!$form->wasSubmitted()) {
            return;
        }

        try {
            $this->getUpdateService()
                ->setEntity($entity)
                ->setForm($form)
                ->update();
            ;
        } catch (InvalidFormDataException $caught) {
            Log::logger()->addNotice($caught->getMessage(), $form->getData());
            $this->addErrorMessage($this->getInvalidFormDataMessage());
            return;
        } catch (\Exception $caught) {
            Log::logger()->addCritical(
                $caught->getMessage(),
                $form->getData()
            );
            $this->addErrorMessage($this->getGeneralErrorMessage($caught));
            return;
        }

        $this->addSuccessMessage(
            $this->getEditSuccessMessage($this->getUpdateService()->getEntity())
        );
        $this->redirectFromEdit($entity);
    }
963095
private static function deleteExtend(string $entity, int $id)
    {
        $del = new TableCrud($entity);
        $del->load($id);
        if ($del->exist())
            $del->delete();
    }
1031482
public function afterDelete(Event $event, Entity $entity) {
        // configuration set?
        $this->check();

        // delete existing files linked to this entity
        foreach($this->_config['fields'] as $field => $path)
            $this->deleteFile($entity->get($field));
    }
642714
public function delete($id)
    {
        $this->beforeDelete($id);
        $this->entity->delete($id);
        $this->afterDelete($id);
    }
938153
public function deleteAction($entityId)
    {
        $this->checkAuth($this->resources, $this->modules, AccessManager::DELETE);

        $con = Propel::getConnection();
        $con->beginTransaction();

        try {
            $event = $this->getDeleteEvent($entityId);

            $obj = $this->extractObjectFromEvent($event);

            if (null === $obj || false === $obj) {
                $this->entityNotFound($entityId);
            }

            $dispatcher = $this->getDispatcher();
            foreach ($this->deleteEvents as $eventName) {
                $dispatcher->dispatch($eventName, $event);
            }

            $con->commit();
        } catch (HttpException $e) {
            $con->rollBack();

            return new JsonResponse(["error" => $e->getMessage()], $e->getStatusCode());
        } catch (\Exception $e) {
            $con->rollBack();

            return new JsonResponse(["error" => $e->getMessage()], 500);
        }

        return $this->nullResponse(204);
    }
99052
public function deleteEntityById($entity, $id)
    {
        $tbl = $this->_resource->getTableName($entity);
        $where = [];
        foreach ($id as $field => $value) {
            $where["`$field`=?"] = $value;
        }
        $result = $this->_conn->delete($tbl, $where);
        return $result;
    }
1094312
public function deleteFieldDefinition($typeId, $status, $fieldDefinitionId)
    {
        try {
            return $this->innerGateway->deleteFieldDefinition($typeId, $status, $fieldDefinitionId);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
784975
public function delete($entityId)
    {
        $response = $this->client->delete(sprintf('/entities/%s', $entityId));

        return $this->decodeResponse($response);
    }
380881
public function populate($id)
    {
        if (empty($id)) {
            throw new EntityException('No messages id supplied', EntityException::NO_MESSAGE_ID_SUPPLIED);
        }

        $this->sendApiCall(self::ACTION_RETRIEVE, $this->getCreateUrl() . '/' . $id);
    }
333884
public function bindEntity($entity, $fields = null, $validatable = true)
    {
        if ($this->submitted) {
            throw new BadMethodCallException("Entities cannot be assigned after FormHandler::handleRequest has been called");
        }

        $this->entities[] = array('entity' => $entity, 'fields' => $fields, 'validatable' => $validatable);

        if ($entity instanceof EntityInterface) {
            $entityData = $entity->getFormData(array_keys($this->fields), $fields);
        } else {
            $entityData = $this->entityProcessor->getFromEntity($entity, array_keys($this->fields), $fields);
        }

        $entityData = $this->transformToFormData($entityData);

        $this->data = array_replace_recursive($this->data, $entityData);
    }
384387
public function afterDelete(Event $event, EntityInterface $entity) {
		if ($this->_checkEvent($event)) {
			$event->result = $this->_deleteFile($event);
			$event->stopPropagation();
		}
	}
227992
public function deleteTreeItem($entityClass = '',
        $id)
    {
        if ($entityClass === '') {
            throw new Exception('messages.error.classNameNotProvided');
        }
        $entity = $this->findById($id);
        $difference = $entity->rgt - $entity->lft + 1;

        $deleteTree = '
                DELETE FROM ' . $entityClass . ' a
                WHERE a.lft >= ' . $entity->lft . '
                    AND a.rgt <= ' . $entity->rgt . '
            ';
        $qTree = $this->query($deleteTree);
        $qTree->execute();

        $updateLft = '
                UPDATE ' . $entityClass . ' a
                SET a.lft = a.lft - ' . $difference . '
                WHERE a.lft > ' . $entity->rgt . '
            ';
        $qLft = $this->query($updateLft);
        $qLft->execute();

        $updateRgt = '
                UPDATE ' . $entityClass . ' a
                SET a.rgt = a.rgt - ' . $difference . '
                WHERE a.rgt > ' . $entity->rgt . '
            ';
        $qRgt = $this->query($updateRgt);
        $qRgt->execute();
    }
175993
public function addUserTypeEntityIfNotExists($entityId, $fieldName, $fields) {
        $item = $this->getUserTypeEntity($entityId, $fieldName);
        if ($item) {
            return $item['ID'];
        }

        return $this->addUserTypeEntity($entityId, $fieldName, $fields);
    }
82419
public function setEntity($entity, $entityId)
    {
        //set the entity
        $method = 'set'.ucfirst($entityId);

        //set the entity
        call_user_func([$this, $method], $entity);
    }