function LinkitPluginEntity::__construct in Linkit 7.2
Initialize this plugin with the plugin, profile, and entity specific variables.
Parameters
object $profile: The Linkit profile to use.
array $plugin: The plugin array.
Overrides LinkitPlugin::__construct
2 calls to LinkitPluginEntity::__construct()
- LinkitPluginTaxonomy_Term::__construct in plugins/
linkit_plugins/ linkit-plugin-taxonomy_term.class.php - Initialize this plugin with the plugin, profile, and entity specific variables.
- LinkitPluginUser::__construct in plugins/
linkit_plugins/ linkit-plugin-user.class.php - Initialize this plugin with the plugin, profile, and entity specific variables.
2 methods override LinkitPluginEntity::__construct()
- LinkitPluginTaxonomy_Term::__construct in plugins/
linkit_plugins/ linkit-plugin-taxonomy_term.class.php - Initialize this plugin with the plugin, profile, and entity specific variables.
- LinkitPluginUser::__construct in plugins/
linkit_plugins/ linkit-plugin-user.class.php - Initialize this plugin with the plugin, profile, and entity specific variables.
File
- plugins/
linkit_plugins/ linkit-plugin-entity.class.php, line 52 - Define Linkit entity plugin.
Class
- LinkitPluginEntity
- @file Define Linkit entity plugin.
Code
function __construct($plugin, $profile) {
parent::__construct($plugin, $profile);
// Load the corresponding entity.
$this->entity_info = entity_get_info($this->plugin['entity_type']);
// Set bundle key name.
if (isset($this->entity_info['entity keys']['bundle']) && !isset($this->entity_key_bundle)) {
$this->entity_key_bundle = $this->entity_info['entity keys']['bundle'];
}
// Set the label field name.
if (!isset($this->entity_field_label)) {
$this->entity_field_label = $this->entity_info['entity keys']['label'];
}
// Make a shortcut for the profile data settings for this plugin.
$this->conf = isset($this->profile->data[$this->plugin['name']]) ? $this->profile->data[$this->plugin['name']] : array();
}