insertSection() abstract public méthode

Inserts a new section with $name and $identifier.
abstract public insertSection ( string $name, string $identifier ) : integer
$name string
$identifier string
Résultat integer The ID of the new section
 /**
  * Create a new section
  *
  * @param string $name
  * @param string $identifier
  *
  * @return \eZ\Publish\SPI\Persistence\Content\Section
  */
 public function create($name, $identifier)
 {
     $section = new Section();
     $section->name = $name;
     $section->identifier = $identifier;
     $section->id = $this->sectionGateway->insertSection($name, $identifier);
     return $section;
 }
 /**
  * Inserts a new section with $name and $identifier.
  *
  * @param string $name
  * @param string $identifier
  *
  * @return int The ID of the new section
  */
 public function insertSection($name, $identifier)
 {
     try {
         return $this->innerGateway->insertSection($name, $identifier);
     } catch (DBALException $e) {
         throw new RuntimeException('Database error', 0, $e);
     } catch (PDOException $e) {
         throw new RuntimeException('Database error', 0, $e);
     }
 }