getStorage('taxonomy_term') ->loadByProperties(array('name' => $name)); if ($terms) { $return[] = array_shift($terms)->id(); } else { throw new \Exception(sprintf("No term '%s' exists.", $name)); } } return $return; } }