eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway::countLocationsByContentId PHP Method

countLocationsByContentId() abstract public method

Returns how many locations given content object identified by $contentId has.
abstract public countLocationsByContentId ( integer $contentId ) : integer
$contentId integer
return integer
    public abstract function countLocationsByContentId($contentId);

Usage Example

Exemplo n.º 1
0
 /**
  * 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);
     }
 }
All Usage Examples Of eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway::countLocationsByContentId