eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway::insertType PHP Method

insertType() abstract public method

Inserts a new content type.
abstract public insertType ( eZ\Publish\SPI\Persistence\Content\Type $type, mixed | null $typeId = null ) : mixed
$type eZ\Publish\SPI\Persistence\Content\Type
$typeId mixed | null
return mixed Type ID
    public abstract function insertType(Type $type, $typeId = null);

Usage Example

 /**
  * Inserts a new content type.
  *
  * @param \eZ\Publish\SPI\Persistence\Content\Type $type
  * @param mixed|null $typeId
  *
  * @return mixed Type ID
  */
 public function insertType(Type $type, $typeId = null)
 {
     try {
         return $this->innerGateway->insertType($type, $typeId);
     } catch (DBALException $e) {
         throw new RuntimeException('Database error', 0, $e);
     } catch (PDOException $e) {
         throw new RuntimeException('Database error', 0, $e);
     }
 }
All Usage Examples Of eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway::insertType