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

insertSection() public method

Inserts a new section with $name and $identifier.
public insertSection ( string $name, string $identifier ) : integer
$name string
$identifier string
return integer The ID of the new section
    public function insertSection($name, $identifier)
    {
        $query = $this->dbHandler->createInsertQuery();
        $query->insertInto($this->dbHandler->quoteTable('ezsection'))->set($this->dbHandler->quoteColumn('id'), $this->dbHandler->getAutoIncrementValue('ezsection', 'id'))->set($this->dbHandler->quoteColumn('name'), $query->bindValue($name))->set($this->dbHandler->quoteColumn('identifier'), $query->bindValue($identifier));
        $query->prepare()->execute();
        return $this->dbHandler->lastInsertId($this->dbHandler->getSequenceName('ezsection', 'id'));
    }