deleteNames() abstract public method

If $versionNo is set only names for that version are deleted.
abstract public deleteNames ( integer $contentId, integer | null $versionNo = null )
$contentId integer
$versionNo integer | null
Example #1
0
 /**
  * Deletes given version, its fields, node assignment, relations and names.
  *
  * Removes the relations, but not the related objects.
  *
  * @param int $contentId
  * @param int $versionNo
  *
  * @return bool
  */
 public function deleteVersion($contentId, $versionNo)
 {
     $versionInfo = $this->loadVersionInfo($contentId, $versionNo);
     $this->locationGateway->deleteNodeAssignment($contentId, $versionNo);
     $this->fieldHandler->deleteFields($contentId, $versionInfo);
     $this->contentGateway->deleteRelations($contentId, $versionNo);
     $this->contentGateway->deleteVersions($contentId, $versionNo);
     $this->contentGateway->deleteNames($contentId, $versionNo);
 }
 /**
  * Deletes all names of $contentId.
  * If $versionNo is set only names for that version are deleted.
  *
  * @param int $contentId
  * @param int|null $versionNo
  *
  * @return void
  */
 public function deleteNames($contentId, $versionNo = null)
 {
     try {
         return $this->innerGateway->deleteNames($contentId, $versionNo);
     } catch (DBALException $e) {
         throw new RuntimeException('Database error', 0, $e);
     } catch (PDOException $e) {
         throw new RuntimeException('Database error', 0, $e);
     }
 }
Example #3
0
 /**
  * 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);
 }