class CerCommerceProductReferenceField in Corresponding Entity References 7.3
@file Contains a CER plugin for Commerce's Product Reference fields.
Hierarchy
- class \FieldInstance
- class \CerField
Expanded class hierarchy of CerCommerceProductReferenceField
1 string reference to 'CerCommerceProductReferenceField'
- cer_commerce_cer_fields in extensions/
cer_commerce/ cer_commerce.cer.inc - Implements hook_cer_fields().
File
- extensions/
cer_commerce/ commerce_product_reference.inc, line 8 - Contains a CER plugin for Commerce's Product Reference fields.
View source
class CerCommerceProductReferenceField extends CerField {
/**
* Implements CerField::getTargetType().
*/
public function getTargetType() {
return 'commerce_product';
}
/**
* Overrides CerField::getTargetBundles().
*/
public function getTargetBundles() {
// Product reference fields store their referenceable types by instance
// instead of by field, so the $this->settings variable we inherit
// from CerField is useless here.
$instance = field_info_instance($this->entityType, $this->name, $this->bundle);
$types = $instance['settings']['referenceable_types'];
return $types ? $types : parent::getTargetBundles();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CerCommerceProductReferenceField:: |
public | function |
Overrides CerField::getTargetBundles(). Overrides CerField:: |
|
CerCommerceProductReferenceField:: |
public | function |
Implements CerField::getTargetType(). Overrides CerField:: |
|
CerField:: |
public | property | ||
CerField:: |
protected | property | The plugin definition. | |
CerField:: |
protected | property | ||
CerField:: |
public | function | Returns a CerFieldHandler subclass instance for the given entity. | |
CerField:: |
public | function |
Overridden. Overrides FieldInstance:: |
|
CerField:: |
public static | function | Returns a single field plugin instance, by its identifier. All plugin instances are statically cached. | |
CerField:: |
public static | function | Returns information about a particular field plugin by its identifier, or all available plugins (i.e., defined by hook_cer_fields()) if no identifier is given. The aggregated result of hook_cer_fields() is statically cached. | |
CerField:: |
public | function |
Overridden. Overrides FieldInstance:: |
|
CerField:: |
public | function |
Constructor. Pretty self-explanatory! Overrides FieldInstance:: |
1 |
FieldInstance:: |
public | property | The instance bundle. | |
FieldInstance:: |
public | property | The human-readable label of the instance's bundle. | |
FieldInstance:: |
public | property | The cardinality (maximum values) the field supports, or FIELD_CARDINALITY_UNLIMITED. | |
FieldInstance:: |
protected | property | The child of this instance, if any. | |
FieldInstance:: |
public | property | The instance's entity type. | |
FieldInstance:: |
public | property | The human-readable label of the instance's entity type. | |
FieldInstance:: |
public | property | Whether or not this instance's entity type supports bundles. | |
FieldInstance:: |
public | property | The instance's label. | |
FieldInstance:: |
public | property | The field's machine name. | |
FieldInstance:: |
protected | property | The parent of this instance, if any. | |
FieldInstance:: |
public | function | Get or set the child of this field instance. | |
FieldInstance:: |
public | function | Get or set the parent of this field instance. | |
FieldInstance:: |
public | function |