eZ\Publish\Core\Persistence\Legacy\Content\Section\Gateway::deleteSection PHP Method

deleteSection() abstract public method

Deletes the Section with $id.
abstract public deleteSection ( integer $id )
$id integer
    public abstract function deleteSection($id);

Usage Example

 /**
  * Delete a section
  *
  * Might throw an exception if the section is still associated with some
  * content objects. Make sure that no content objects are associated with
  * the section any more *before* calling this method.
  *
  * @param mixed $id
  */
 public function delete($id)
 {
     $contentCount = $this->sectionGateway->countContentObjectsInSection($id);
     if ($contentCount > 0) {
         throw new RuntimeException("Section with ID '{$id}' still has content assigned.");
     }
     $this->sectionGateway->deleteSection($id);
 }
All Usage Examples Of eZ\Publish\Core\Persistence\Legacy\Content\Section\Gateway::deleteSection