Remove an entity from the database using the id of the entity.
@param $entity \Fredy\Model\Entity\Entity

@return void
184195
public function remove($entity)
    {
        if ($entity->isValid() && is_numeric($entity['id']->value)) {
            $query = 'DELETE FROM `' . $this->tableName . '` WHERE `id`=:id';
            $statement = $this->database->prepare($query);
            $statement->bindParam(':id', $entity['id']->value);
            return $statement->execute();
            // #@todo throw and exception if $stmt->errorInfo() has an error?
            // var_dump($stmt->errorInfo());
        } else {
            // #@todo: handle invalid entity
            // #@todo: handle invalid id
        }
    }
1115769
public function remove($entity)
    {
        if ($this->evm->hasListeners(Events::preRemove)) {
            $this->evm->dispatchEvent(Events::preRemove, new Event\LifecycleEventArgs($entity, $this->sm));
        }

        $oid = spl_object_hash($entity);
        $this->scheduledForDelete[$oid] = $entity;

        if ($this->evm->hasListeners(Events::postRemove)) {
            $this->evm->dispatchEvent(Events::postRemove, new Event\LifecycleEventArgs($entity, $this->sm));
        }
    }
689497
public function delete($document): void
    {
        $class = $this->dm->getClassMetadata(get_class($document));
        $id = $class->getSingleIdentifier($document);

        $this->collection->delete((string) $id);
    }
1289693
public function delete($entity)
    {
        if (!$this->isRepositoryDeletable()) {
            throw $this->createNotDeletableException();
        }

        return $this->trigger(__FUNCTION__, [
            'entity' => $entity,
        ]);
    }
856409
public function delete(Entity $entity) {
    $this->remove($entity);
    $this->_em->flush();
    
    return $this;
  }
1028619
public function _performDelete($id)
    {
        if ($this->model) {
            $this->model->delete($id);
        } else {
            $this->dq->where('id', $id)->delete();
        }
    }
648636
public function remove(int $id) : bool
    {
        if ($this->has($id)) {
            unset($this->entities[$id]);

            // Entities are mutable
            // Search through the previously null-id entities
            // in case an id has been set now.
            foreach ($this->nullIdEntities as $key => $entity) {
                if ($entity->getId() === $id) {
                    unset($this->nullIdEntities[$key]);
                }
            }

            return true;
        }

        return false;
    }
1315474
public function remove(AbstractEntity $entity)
    {
        for ($i = count($this->registries) - 1; $i >= 0; $i--) {
            /** @var RegistryInterface $registry */
            $registry = $this->registries[ $i ];
            $registry->remove($entity->getId());
        }
    }
835990
public function removeNode(\Ydle\HubBundle\Entity\Node $node)
    {
        $this->nodes->removeElement($node);
    }
715776
public function delete($entity)
    {
        $this->gateway->delete($this->tableName, $this->builder->reduce($entity), $this->getIdentifier($entity));
    }
465565
public function update($entity)
    {
        $identifier = $this->getIdentifier($entity);
        $data       = $this->builder->reduce($entity);

        $this->connection->update($this->tableName, $data, $identifier);

        $this->builder->resolve($entity);
    }
703702
public void removeEntity(Entity entity){
		boolean delayed = updating || familyManager.notifying();
		entityManager.removeEntity(entity, delayed);
	}
1199281
public function remove(AbstractEntity $entity)
    {
        if ($this->prepareEntityForRemove($entity)) {
            $this->getRepository()->remove($entity);
        }
    }
325700
public function delete($id)
    {
        $query = $this->createQueryBuilder();

        $query->where($this->getPrimaryKey($query), $id);
        $query->delete();
    }
963095
private static function deleteExtend(string $entity, int $id)
    {
        $del = new TableCrud($entity);
        $del->load($id);
        if ($del->exist())
            $del->delete();
    }
306712
protected function removeEntity(EntityInterface $entity)
    {
        Orm::getRepository($this->getEntityClassName())
            ->getIdentityMap()
            ->remove($entity);
    }
1187733
public function deleteUserDataThreadInfo(Entity $entity) {
    $this->userData->delete('private_message', $this->currentUser->id(), 'private_message_thread:' . $entity->id());
  }