Exemple #1
0
 private function _validate_rdf_type($type)
 {
     $types = is_array($type) ? $type : array($type);
     $urls = array();
     foreach ($this->content_types as $name) {
         $urls[$name] = MY_Model::rdf_type($name);
     }
     $valid_type = false;
     foreach ($types as $type) {
         if ($hit = array_search($type, $urls)) {
             $valid_type = true;
         }
     }
     if (!$valid_type) {
         $this->_output_error(StatusCodes::HTTP_BAD_REQUEST, 'Invalid rdf:type value.');
     }
     return $hit;
 }