insertNewField() abstract public method

Only used when a new field is created (i.e. a new object or a field in a new language!). After that, field IDs need to stay the same, only the version number changes.
abstract public insertNewField ( eZ\Publish\SPI\Persistence\Content $content, eZ\Publish\SPI\Persistence\Content\Field $field, StorageFieldValue $value ) : integer
$content eZ\Publish\SPI\Persistence\Content
$field eZ\Publish\SPI\Persistence\Content\Field
$value StorageFieldValue
return integer ID
 /**
  * Inserts a new field.
  *
  * Only used when a new field is created (i.e. a new object or a field in a
  * new language!). After that, field IDs need to stay the same, only the
  * version number changes.
  *
  * @param \eZ\Publish\SPI\Persistence\Content $content
  * @param \eZ\Publish\SPI\Persistence\Content\Field $field
  * @param \eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldValue $value
  *
  * @return int ID
  */
 public function insertNewField(Content $content, Field $field, StorageFieldValue $value)
 {
     try {
         return $this->innerGateway->insertNewField($content, $field, $value);
     } catch (DBALException $e) {
         throw new RuntimeException('Database error', 0, $e);
     } catch (PDOException $e) {
         throw new RuntimeException('Database error', 0, $e);
     }
 }
 /**
  * Copies existing field to new field for given $languageCode.
  *
  * Used by self::createNewFields() and self::updateFields()
  *
  * @param \eZ\Publish\SPI\Persistence\Content\Field $originalField
  * @param string $languageCode
  * @param \eZ\Publish\SPI\Persistence\Content $content
  *
  * @return void
  */
 protected function copyField(Field $originalField, $languageCode, Content $content)
 {
     $originalField->versionNo = $content->versionInfo->versionNo;
     $field = clone $originalField;
     $field->languageCode = $languageCode;
     $field->id = $this->contentGateway->insertNewField($content, $field, $this->mapper->convertToStorageValue($field));
     // If the storage handler returns true, it means that $field value has been modified
     // So we need to update it in order to store those modifications
     // Field converter is called once again via the Mapper
     if ($this->storageHandler->copyFieldData($content->versionInfo, $field, $originalField) === true) {
         $this->contentGateway->updateField($field, $this->mapper->convertToStorageValue($field));
     }
     $content->fields[] = $field;
 }