thrownewFieldException(format_string('Attempt to create an instance of field @field_name that does not exist on entity type @entity_type.',array('@field_name'=>$values['field_name'],'@entity_type'=>$values['entity_type'])));
}
// Check required properties.
if(empty($values['field_name'])){
thrownewFieldException('Attempt to create an instance of a field without a field_name.');
thrownewFieldException(format_string('Attempt to create an instance of field @field_name that does not exist on entity type @entity_type.',array('@field_name'=>$values['field_name'],'@entity_type'=>$values['entity_type'])));
}
$values['field_uuid']=$field->uuid();
if(empty($values['entity_type'])){
thrownewFieldException(String::format('Attempt to create an instance of field @field_name without an entity_type.',array('@field_name'=>$values['field_name'])));
}
else{
thrownewFieldException('Attempt to create an instance of an unspecified field.');
if(empty($values['bundle'])){
thrownewFieldException(String::format('Attempt to create an instance of field @field_name without a bundle.',array('@field_name'=>$values['field_name'])));
}
// At this point, we have a Field we can assign.
$this->field=$field;
// Discard the 'field_type' entry that is added in config records to ease
// schema generation. See self::toArray().
unset($values['field_type']);
// Check required properties.
if(empty($values['entity_type'])){
thrownewFieldException(format_string('Attempt to create an instance of field @field_name without an entity_type.',array('@field_name'=>$this->field->name)));
}
if(empty($values['bundle'])){
thrownewFieldException(format_string('Attempt to create an instance of field @field_name without a bundle.',array('@field_name'=>$this->field->name)));
}
// 'Label' defaults to the field name (mostly useful for field instances
thrownewFieldException(String::format('Attempt to create an instance of field @field_name that does not exist on entity type @entity_type.',array('@field_name'=>$this->field_name,'@entity_type'=>$this->entity_type)));
thrownewFieldException(String::format('Attempt to create an instance of field @field_name that does not exist on entity type @entity_type.',array('@field_name'=>$this->field_name,'@entity_type'=>$this->entity_type)));
thrownewFieldException(String::format('Attempt to create a configurable instance of non-configurable field @field_name.',array('@field_name'=>$this->field_name,'@entity_type'=>$this->entity_type)));
}
$field=$fields[$this->field_name];
}
$this->field=$field;
}
return$this->field;
}
...
...
@@ -480,21 +505,21 @@ public function getField() {