@@ -104,7 +104,12 @@ function materio_search_api_entity_property_info_alter(&$info){
|
||||
'getter callback'=>'materio_search_api_get_main_taxonomy_term_'.$i,
|
||||
);
|
||||
}
|
||||
|
||||
$properties['materio_search_api_taxonomy_term_'.$i] = array(
|
||||
'type'=>'taxonomy_term',
|
||||
'label'=> t('Taxonomy term after 5 mains'),
|
||||
'query callback'=>'entity_metadata_table_query',
|
||||
'getter callback'=>'materio_search_api_get_taxonomy_terms_after_5',
|
||||
);
|
||||
return $properties;
|
||||
}
|
||||
|
||||
@@ -129,6 +134,18 @@ function materio_search_api_get_main_taxonomy_term_5($item){
|
||||
return materio_search_api_get_onto_term($item, 4);
|
||||
}
|
||||
|
||||
function materio_search_api_get_taxonomy_terms_after_5($item){
|
||||
if(isset($item->field_onthologie['und'])){
|
||||
$terms = array();
|
||||
foreach ($item->field_onthologie['und'] as $delta => $value) {
|
||||
if($delta>4)
|
||||
$terms[] = taxonomy_term_load($item->field_onthologie['und'][$delta]['tid']);
|
||||
}
|
||||
return $terms;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function materio_search_api_get_onto_term($item, $delta){
|
||||
// dsm($item, 'item');
|
||||
// dsm($delta, 'delta');
|
||||
|
||||
Reference in New Issue
Block a user