Will NOT remove associated content object nor attributes.
abstract public removeElementFromTrash ( integer $id ) | ||
$id | integer | The trashed location Id |
/** * Deletes raw content data * * @param int $contentId */ public function removeRawContent($contentId) { $this->locationGateway->removeElementFromTrash($this->loadContentInfo($contentId)->mainLocationId); foreach ($this->listVersions($contentId) as $versionInfo) { $this->fieldHandler->deleteFields($contentId, $versionInfo); } $this->contentGateway->deleteRelations($contentId); $this->contentGateway->deleteVersions($contentId); $this->contentGateway->deleteNames($contentId); $this->contentGateway->deleteContent($contentId); }
/** * Triggers delete operations for $trashItem. * If there is no more locations for corresponding content, then it will be deleted as well. * * @param \eZ\Publish\SPI\Persistence\Content\Location\Trashed $trashItem * * @return void */ protected function delete(Trashed $trashItem) { $this->locationGateway->removeElementFromTrash($trashItem->id); if ($this->locationGateway->countLocationsByContentId($trashItem->contentId) < 1) { $this->contentHandler->deleteContent($trashItem->contentId); } }
/** * Removes trashed element identified by $id from trash. * Will NOT remove associated content object nor attributes. * * @param int $id The trashed location Id * * @return void */ public function removeElementFromTrash($id) { try { return $this->innerGateway->removeElementFromTrash($id); } catch (DBALException $e) { throw new RuntimeException('Database error', 0, $e); } catch (PDOException $e) { throw new RuntimeException('Database error', 0, $e); } }