Fixing method name

This commit is contained in:
Leo Germani 2018-03-08 12:43:21 -03:00
parent 877fd32939
commit 066842bed2
2 changed files with 2 additions and 27 deletions

View File

@ -67,8 +67,8 @@ class Taxonomy extends Entity {
$tax_cpts = [];
if (is_array($this->fetch())){
foreach ($this->fetch() as $tax_col){
if (is_array($this->get_collections())){
foreach ($this->get_collections() as $tax_col){
$tax_cpts[] = $tax_col->get_db_identifier();
}
}

View File

@ -7,31 +7,6 @@ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
trait Entity_Collections_Relation {
public function fetch_ids() {
return $this->get_mapped_property('collections_ids');
}
public function fetch() {
if (isset($this->collection) && !empty($this->collection) && is_array($this->collection)){
return $this->collection;
}
if (is_array($this->fetch_ids()) && !empty(is_array($this->fetch_ids()))) {
global $Tainacan_Collections;
$collections = [];
foreach ($this->fetch_ids() as $col_id) {
$collections[] = $Tainacan_Collections->fetch($col_id);
}
return $collections;
}
return null;
}
public function get_collections_ids() {
return $this->get_mapped_property('collections_ids');
}