/** * Returns the associated MetaDataType * @return MetaDataType */ public function getType() { return MetaDataType::get($this->meta_type_id); }
} } if (!has_error()) { echo "<h2>" . $category->getLabel() . "</h2>"; echo "<div class=\"content-small\">for " . $organisation->getTitle() . " > " . ucwords($group) . " > " . ucwords($opts["associated_role"]) . "</div><br />"; echo editMetaDataTable_Category($organisation_id, $group, $role, null, $category); } else { //if there were any errors, return a 500 and display errors header("HTTP/1.0 500 Internal Error"); echo display_status_messages(false); } break; case 'new_value': $cat_id = filter_input(INPUT_POST, "type", FILTER_SANITIZE_NUMBER_INT); $proxy_id = filter_input(INPUT_POST, "proxy_id", FILTER_SANITIZE_NUMBER_INT); $type = MetaDataType::get($cat_id); if ($type) { $user = User::get($proxy_id); $org_id = $user->getOrganisationId(); $group = $user->getGroup(); $role = $user->getRole(); $types = MetaDataTypes::get($org_id, $group, $role, $proxy_id); $value_id = MetaDataValue::create($cat_id, $proxy_id); $value = MetaDataValue::get($value_id); $descendant_type_sets = getDescendentTypesArray($types, $type); header("Content-Type: application/xml"); echo editMetaDataRow($value, $type, $descendant_type_sets); } else { header("HTTP/1.0 500 Internal Error"); echo display_error("Invalid type. Please try again."); }
/** * Returns the parent type, if any. Returns null if none is found. * <code> * $type = $value->getType(); * $parent = $type->getParent(); * </code> * @return MetaDataType */ public function getParent() { if ($this->parent_type_id) { return MetaDataType::get($this->parent_type_id); } }