I have a custom entity "Matching" with a multi value field entity reference jobs that references a node of type job.
function custom_alters_entity_property_info_alter(&$info) {
$info['node']['properties']['referencing_matching'] = array(
'label' => t('Referencing matching'),
'type' => "entities",
'description' => t("Matchings referecing a job"),
'getter callback' => 'get_referencing_matching'
);
}
function referencing_matching($node) {
if($node->type == "job"){
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'matching')
->fieldCondition('field_job_id', 'target_id', $node->nid, '=');
$result = $query->execute();
if ($result) {
return $result;
}
}
the "getter callback" isn't expecting an id rather than an array