public function insertType(Type $type, $typeId = null)
{
$q = $this->dbHandler->createInsertQuery();
$q->insertInto($this->dbHandler->quoteTable('ezcontentclass'));
$q->set($this->dbHandler->quoteColumn('id'), isset($typeId) ? $q->bindValue($typeId, null, \PDO::PARAM_INT) : $this->dbHandler->getAutoIncrementValue('ezcontentclass', 'id'))->set($this->dbHandler->quoteColumn('version'), $q->bindValue($type->status, null, \PDO::PARAM_INT))->set($this->dbHandler->quoteColumn('created'), $q->bindValue($type->created, null, \PDO::PARAM_INT))->set($this->dbHandler->quoteColumn('creator_id'), $q->bindValue($type->creatorId, null, \PDO::PARAM_INT));
$this->setCommonTypeColumns($q, $type);
$q->prepare()->execute();
if (empty($typeId)) {
$typeId = $this->dbHandler->lastInsertId($this->dbHandler->getSequenceName('ezcontentclass', 'id'));
}
$this->insertTypeNameData($typeId, $type->status, $type->name);
return $typeId;
}