Delete entity's corresponding database row.

@param AbstractDbEntity $dbEntity
966143
public function delete(AbstractDbEntity $dbEntity)
    {
        if (!$dbEntity->getPrimaryDbValue()) {
            throw new \InvalidArgumentException('Primary database value not set');
        }

        $this->db->exec(
            'DELETE FROM `' . $dbEntity->getDbTableName() . '` WHERE ' . $this->getPrimaryKeyWhereSql($dbEntity),
            $this->getPrimaryKeyWhereParameters($dbEntity)
        );

        $dbEntity->setDeleted();
    }
1214999
public function remove(AbstractEntity $entity)
    {
        $this->getEntityManager()->remove($entity);
        $this->getEntityManager()->flush();
    }
507803
protected function prepareEntityForPersist(AbstractEntity $entity): bool
    {
        if ($entity instanceof TimestampableInterface) {
            $entity->setEditionDate(new DateTime());
        }

        return true;
    }
266500
public function delete($entity) {
		if (is_null($entity))
			return;
		
		//connect to database
		$this->mapper->connect();
		
		//begin transaction
		$this->mapper->beginTransaction();
		
		//get primary key
		$pk = $this->getPropertyValue($this->entityProfile, $entity, $this->entityProfile->getPrimaryKey());

		foreach ($this->entityProfile->getReferences() as $assoc)
			$this->entityProfile->getAssociation($assoc)->delete($this->mapper, $pk);
		
		//build fluent query
		$query = $this->mapper->newQuery()
		->deleteFrom($this->entityProfile->getEntityTable())
		->where(Column::__callstatic($this->entityProfile->getPrimaryKey(true))->eq($pk));
		
		//run query
		$result = $query->exec();
		
		//commit
		$this->mapper->commit();
		return $result;
	}
544312
public function deleteUserTypeEntitiesIfExists($entityId, array $fields) {
        foreach ($fields as $fieldName) {
            $this->deleteUserTypeEntityIfExists($entityId, $fieldName);
        }
    }
856409
public function delete(Entity $entity) {
    $this->remove($entity);
    $this->_em->flush();
    
    return $this;
  }
1146005
def ndb_delete(self, entity_or_key):
    """"""
    if ndb is not None and isinstance(entity_or_key, ndb.Model):
      key = entity_or_key.key
    else:
      key = entity_or_key
    self.ndb_deletes.append(key)
892199
public function deleteEntityByPk($entity, $pk)
    {
        $tbl = $this->resource->getTableName($entity);
        $where = [];
        foreach ($pk as $field => $value) {
            $where["$field=?"] = $value;
        }
        $result = $this->conn->delete($tbl, $where);
        return $result;
    }
791874
public function delete($entity)
    {
        $identifier   = $this->getIdentifier($entity);
        $affectedRows = $this->connection->delete($this->tableName, $identifier);

        if ($affectedRows == 0) {
            throw new OrmException("Entity not found.");
        }
    }
501324
protected function deleteManyToManyReferences(Entity $entity)
    {
        foreach ($this->definition->getService()->getEntities() as $entityName) {
            $data = $this->definition->getService()->getData($entityName);
            foreach ($data->getDefinition()->getFieldNames(true) as $field) {
                if ($data->getDefinition()->getType($field) == 'many') {
                    $otherEntity = $data->getDefinition()->getSubTypeField($field, 'many', 'entity');
                    $otherData   = $this->definition->getService()->getData($otherEntity);
                    if ($entity->getDefinition()->getTable() == $otherData->getDefinition()->getTable()) {
                        $thatField    = $data->getDefinition()->getSubTypeField($field, 'many', 'thatField');
                        $queryBuilder = $this->database->createQueryBuilder();
                        $queryBuilder
                            ->delete('`'.$field.'`')
                            ->where('`'.$thatField.'` = ?')
                            ->setParameter(0, $entity->get('id'))
                            ->execute()
                        ;
                    }
                }
            }
        }
    }
454339
protected function prepareEntityForNew(AbstractEntity $entity): bool
    {
        if ($entity instanceof TimestampableInterface) {
            $entity->setCreationDate(new DateTime());
            $entity->setEditionDate(new DateTime());
        }

        return $this->prepareEntityForGet($entity);
    }
601131
protected function removeEntity (...$entities) : void
    {
        try
        {
            $entities = \array_filter($entities);

            if (empty($entities))
            {
                return;
            }

            $entityManager = $this->getEntityManager();
            \array_map([$entityManager, "remove"], $entities);
            $entityManager->flush();
        }
        catch (ForeignKeyConstraintViolationException $foreignKeyException)
        {
            throw new EntityRemovalBlockedException(
                $entities,
                "Can't remove entities as a foreign key constraint failed.",
                $foreignKeyException
            );
        }
    }
727727
public function delete(EntityInterface $entity, array $commandOptions = array())
    {
        $this->dispatchEntityRequestEvent(Events::ENTITY_PRE_DELETE, $entity);

        $commandOptions += array(
            'TableName' => $this->getEntityTable($entity),
            'Key'       => $this->formatKeyCondition($entity),
        );

        $model = $this->dynamoDb->deleteItem($commandOptions);

        $this->dispatchEntityResponseEvent( Events::ENTITY_POST_DELETE, $entity, $model);
        return true;
    }
969369
public function destroy(Entity $entity)
    {
        if ($entity->isExists()) {

            // enable logical delete ?
            if ($entity->hasAttribute('active')) {
                $attributes = [];
                $attributes['active'] = 0;
                if ($entity->hasAttribute('deleted_at')) $attributes['deleted_at'] = time();
                $this->update($attributes, $entity->getPrimaryValue());
            } else {
                $this->delete($entity->getPrimaryValue());
            }
        }
    }
232048
@SuppressWarnings("unchecked")
	@Override
	public <E> SqlEntityDelete<E> delete(final Class<? extends E> entityType) {
		@SuppressWarnings("rawtypes")
		EntityHandler handler = this.getEntityHandler();
		if (!handler.getEntityType().isAssignableFrom(entityType)) {
			throw new IllegalArgumentException("Entity type not supported");
		}

		try {
			TableMetadata metadata = handler.getMetadata(this.transactionManager, entityType);

			SqlContext context = handler.createDeleteContext(this, metadata, entityType, false);
			context.setSqlKind(SqlKind.DELETE);

			return new SqlEntityDeleteImpl<>(this, handler, metadata, context);
		} catch (SQLException e) {
			throw new EntitySqlRuntimeException(SqlKind.DELETE, e);
		}
	}
72516
public function delete($id)
    {
        $entity = $this->findById($id);
        $entity = $this->beforeDelete($entity);

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

        $this->afterDelete($entity);
    }
572936
public function deleteOne(FlexibleEntityInterface &$entity)
    {
        $entity = $this->deleteByPK($entity->fields($this->getStructure()->getPrimaryKey()));

        return $this;
    }