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

insertType() public method

Inserts a new content type.
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 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);
        }
    }