public function CerPresetSelectionHandler::getReferencableEntities in Corresponding Entity References 7.3
Return a list of referencable entities.
Return value
A nested array of entities, the first level is keyed by the entity bundle, which contains an array of entity labels (safe HTML), keyed by the entity ID.
Overrides EntityReference_SelectionHandler::getReferencableEntities
1 call to CerPresetSelectionHandler::getReferencableEntities()
- CerPresetSelectionHandler::countReferencableEntities in extensions/
cer_entity_settings/ plugins/ entityreference/ selection/ CerPresetSelectionHandler.class.php - Count entities that are referencable by a given field.
File
- extensions/
cer_entity_settings/ plugins/ entityreference/ selection/ CerPresetSelectionHandler.class.php, line 17
Class
Code
public function getReferencableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0) {
$options = array();
if ($this->entity) {
$finder = new CerPresetFinder($this->entity);
$finder
->execute();
foreach ($finder->result['cer'] as $preset) {
$options['cer'][$preset->pid] = $preset->label_variables['@right'];
}
foreach ($finder->result['cer__invert'] as $preset) {
$options['cer'][$preset->pid] = $preset->label_variables['@left'];
}
}
return $options;
}