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;
}
}