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

insertFieldDefinition() abstract public method

Inserts a $fieldDefinition for $typeId.
abstract public insertFieldDefinition ( mixed $typeId, integer $status, eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition $fieldDefinition, StorageFieldDefinition $storageFieldDef ) : mixed
$typeId mixed
$status integer
$fieldDefinition eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition
$storageFieldDef eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldDefinition
return mixed Field definition ID
    public abstract function insertFieldDefinition($typeId, $status, FieldDefinition $fieldDefinition, StorageFieldDefinition $storageFieldDef);

Usage Example

 /**
  * Inserts a $fieldDefinition for $typeId.
  *
  * @param mixed $typeId
  * @param int $status
  * @param \eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition $fieldDefinition
  * @param \eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldDefinition $storageFieldDef
  *
  * @return mixed Field definition ID
  */
 public function insertFieldDefinition($typeId, $status, FieldDefinition $fieldDefinition, StorageFieldDefinition $storageFieldDef)
 {
     try {
         return $this->innerGateway->insertFieldDefinition($typeId, $status, $fieldDefinition, $storageFieldDef);
     } 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::insertFieldDefinition