Bolt\Legacy\Storage::getTaxonomyType PHP Method

getTaxonomyType() public method

Get the taxonomy as an array, based on the given $taxonomyslug.
public getTaxonomyType ( string $taxonomyslug ) : boolean | array
$taxonomyslug string
return boolean | array
    public function getTaxonomyType($taxonomyslug)
    {
        $taxonomyslug = $this->app['slugify']->slugify($taxonomyslug);
        // Return false if empty, can't find it.
        if (empty($taxonomyslug)) {
            return false;
        }
        // See if we've either given the correct contenttype, or try to find it by name or singular_name.
        if ($this->app['config']->get('taxonomy/' . $taxonomyslug)) {
            $taxonomytype = $this->app['config']->get('taxonomy/' . $taxonomyslug);
        } else {
            foreach ($this->app['config']->get('taxonomy') as $key => $tt) {
                if (isset($tt['singular_slug']) && $taxonomyslug == $tt['singular_slug']) {
                    $taxonomytype = $this->app['config']->get('taxonomy/' . $key);
                    break;
                }
            }
        }
        if (!empty($taxonomytype)) {
            return $taxonomytype;
        } else {
            return false;
        }
    }