add metadata type object to filter array object
This commit is contained in:
parent
8fe90b82e8
commit
e35ad08309
|
@ -41,10 +41,12 @@ class Filter extends Entity {
|
|||
public function _toArray(){
|
||||
$filter_array = parent::_toArray();
|
||||
$metadatum_id = $filter_array['metadatum'];
|
||||
$metadatum = $this->get_metadatum();
|
||||
|
||||
$filter_array['metadatum'] = [];
|
||||
$filter_array['metadatum']['metadatum_id'] = $metadatum_id;
|
||||
$filter_array['metadatum']['metadatum_name'] = $this->get_metadatum()->get_name();
|
||||
$filter_array['metadatum']['metadatum_name'] = $metadatum->get_name();
|
||||
$filter_array['metadatum']['metadata_type_object'] = $metadatum->get_metadata_type_object()->_toArray();
|
||||
|
||||
return $filter_array;
|
||||
}
|
||||
|
|
|
@ -180,4 +180,16 @@ class Taxonomy extends Metadata_Type {
|
|||
|
||||
}
|
||||
|
||||
public function _toArray() {
|
||||
|
||||
$array = parent::_toArray();
|
||||
|
||||
if ( isset($array['options']['taxonomy_id']) ) {
|
||||
$array['options']['taxonomy'] = \Tainacan\Repositories\Taxonomies::get_instance()->get_db_identifier_by_id( $array['options']['taxonomy_id'] );
|
||||
}
|
||||
|
||||
return $array;
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue