add new get_filters() method to collection

This commit is contained in:
leogermani 2020-02-11 10:51:39 -03:00
parent e2e57d05bd
commit d9d33987db
1 changed files with 16 additions and 0 deletions

View File

@ -477,6 +477,22 @@ class Collection extends Entity {
return $Tainacan_Metadata->fetch_by_collection( $this );
}
/**
* Get collection filters.
*
* Returns an array of \Entity\Filter objects, representing all the filters of the collection.
*
* @see \Tainacan\Repositories\Filters->fetch()
*
* @return [\Tainacan\Entities\Filter] array
* @throws \Exception
*/
function get_filters() {
$Tainacan_Filters = \Tainacan\Repositories\Filters::get_instance();
return $Tainacan_Filters->fetch_by_collection( $this );
}
/**
* Get the two core metadata of the collection (title and description)
*