Deleta informações extendidas de uma entidade

@param string $entity
@param int $id
963095
private static function deleteExtend(string $entity, int $id)
    {
        $del = new TableCrud($entity);
        $del->load($id);
        if ($del->exist())
            $del->delete();
    }
749466
public function deleteEntity(EntityInterface $entity)
    {
        $delete = $this->tableGateway->getSql()->delete();
        $delete->where->equalTo(
            $this->tableGateway->getPrimaryKey(), $entity->getIdentifier()
        );

        try {
            $this->tableGateway->deleteWith($delete);
        } catch (RuntimeException $e) {
            return false;
        }

        return true;
    }
830237
public function delete($entity) {
        $deleteQuerys = $this->buildDeleteQuery($entity);
        foreach (explode(";", $deleteQuerys) as $q) {
            if (strlen($q) > 5)
                $this->conn->executeNonQuery($q);
        }
        return true;
    }
177265
private function delete($id)
    {
        /* @var Gallery_Entity_Table_Image $table */
        $table = ORM::getTable($this, 'Image');
        $image = $table->find($id);
        $table->delete($image);

        HTTP::redirect(Eresus_Kernel::app()->getPage()->url());
    }
487981
public function destroy($id)
    {
        $this->_table->delete(new Entity(
            [$this->_table->getPrimaryKey() => $id],
            ['markNew' => false]
        ));

        return true;
    }
1359596
public function remove($entity)
    {
        $objectManager = $this->getObjectManager();
        $objectManager->remove($entity);
        $objectManager->flush();
    }
899204
public void delete(Object entity) {
    try {
      entityManager.executeEntityListeners(CallbackType.PRE_DELETE, entity);
      Key nativeKey = Marshaller.marshalKey(entityManager, entity);
      nativeWriter.delete(nativeKey);
      entityManager.executeEntityListeners(CallbackType.POST_DELETE, entity);
    } catch (DatastoreException exp) {
      throw DatastoreUtils.wrap(exp);
    }
  }
875087
public function scheduleForDelete($entity)
    {
        $oid = spl_object_id($entity);

        if (isset($this->entityInsertions[$oid])) {
            if ($this->isInIdentityMap($entity)) {
                $this->removeFromIdentityMap($entity);
            }

            unset($this->entityInsertions[$oid], $this->entityStates[$oid]);

            return; // entity has not been persisted yet, so nothing more to do.
        }

        if (! $this->isInIdentityMap($entity)) {
            return;
        }

        $this->removeFromIdentityMap($entity);

        unset($this->entityUpdates[$oid]);

        if (! isset($this->entityDeletions[$oid])) {
            $this->entityDeletions[$oid] = $entity;
            $this->entityStates[$oid]    = self::STATE_REMOVED;
        }
    }
995921
public static function delete($id)
    {
        $result = (new \CUserTypeEntity())->Delete($id);

        if (!$result) {
            global $APPLICATION;
            throw new \Exception($APPLICATION->GetException());
        }

        Logger::log("Удален UF {$id}", Logger::COLOR_GREEN);
    }
742363
public function deleteRow(int $id) : void
    {
        $this->crudEnabled();

        // Generate the values
        $table_name = static::$table_name;
        $id_column = static::$id_column;

        $sql = "DELETE FROM {$table_name} WHERE {$id_column} = :key";
        $this->dbc->query($sql, ['params' => [':key' => $id]]);
    }
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
        }
    }
314425
public function delete($id)
    {
        $entity = $this->get($id);

        $this->manager->remove($entity);
        $this->manager->flush();
    }
1064799
protected function saveLastId($entity, $id)
    {
        $this->debugLog(sprintf('Last ID fetched: %d', $id));

        $_SESSION['behat']['GenesisSqlExtension']['last_id'][$entity][] = $id;
    }
388522
public function deleteObject($entity, $_id)
	{
		$retValue = true;

		try{
			$m = new MongoDB\Driver\Manager($this->url);
			$bulk = new MongoDB\Driver\BulkWrite;

			$bulk->delete(['_id' => new MongoDB\BSON\ObjectId($_id)], ['limit' => 1]);

			$mCol = $this->db . "."  . $entity;

			$m->executeBulkWrite($mCol, $bulk);
		}
		catch (Exception $e) {
			$this->_log->addError($e->getMessage());
		    $retValue = false;
		}

		return $retValue;
	}
756406
public function delete($id)
    {
        $deleted  = false;
        $instance = $id instanceof Model ? $id : $this->find($id);

        if ($instance) {
            event(implode('-', $this->tag).'.entity.deleting', [$this, $instance]);

            $deleted = $instance->delete();

            event(implode('-', $this->tag).'.entity.deleted', [$this, $instance]);
        }

        return [
            $deleted,
            $instance,
        ];
    }
72516
public function delete($id)
    {
        $entity = $this->findById($id);
        $entity = $this->beforeDelete($entity);

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

        $this->afterDelete($entity);
    }
1187733
public function deleteUserDataThreadInfo(Entity $entity) {
    $this->userData->delete('private_message', $this->currentUser->id(), 'private_message_thread:' . $entity->id());
  }