public function i18n_field::__construct in Internationalization 7
Class constructor
For convenience field objects can be built from field info and from field instance.
Overrides i18n_object_wrapper::__construct
File
- i18n_field/
i18n_field.inc, line 39 - Field and field instance object handlers
Class
- i18n_field
- Field object
Code
public function __construct($type, $key, $object) {
parent::__construct($type, $key, $object);
// If this is a field instance, get field info but add instance data too.
// This instance data will be used to get the paths to get the edit/translate path.
if (isset($this->object['bundle']) && isset($this->object['entity_type'])) {
$this->object = field_info_field($this->object['field_name']) + array(
'bundle' => $this->object['bundle'],
'entity_type' => $object['entity_type'],
);
}
}