public static function getGeneralizations($concept) { Concept::getConcept($concept); // only to check if concept is defined $generalizations = array(); foreach (Concept::getAllConcepts() as $c) { if (in_array($concept, $c['specializations'])) { $generalizations[] = $c['concept']; } } return $generalizations; }
/** * @url GET concept * @url GET concept/{concept} */ public function getConcepts($concept = null) { try { if (isset($concept)) { // return Concept::getConcept(); // Return specific concept throw new RestException(501); // 501: not implemented } else { return array_keys(Concept::getAllConcepts()); // Return list of all concepts } } catch (Exception $e) { throw new RestException($e->getCode(), $e->getMessage()); } }