protected function EasyRdf_Serialiser::checkSerialiseParams

Check and cleanup parameters passed to serialise() method @ignore

8 calls to EasyRdf_Serialiser::checkSerialiseParams()
EasyRdf_Serialiser_Arc::serialise in drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/Arc.php
Serialise an EasyRdf_Graph into RDF format of choice.
EasyRdf_Serialiser_GraphViz::serialise in drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/GraphViz.php
Serialise an EasyRdf_Graph into a GraphViz dot document.
EasyRdf_Serialiser_Json::serialise in drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/Json.php
Method to serialise an EasyRdf_Graph to RDF/JSON
EasyRdf_Serialiser_Ntriples::serialise in drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/Ntriples.php
Serialise an EasyRdf_Graph into N-Triples
EasyRdf_Serialiser_Rapper::serialise in drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/Rapper.php
Serialise an EasyRdf_Graph to the RDF format of choice.

... See full list

File

drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser.php, line 64

Class

EasyRdf_Serialiser
Parent class for the EasyRdf serialiser

Code

protected function checkSerialiseParams(&$graph, &$format) {
  if ($graph == null or !is_object($graph) or get_class($graph) != 'EasyRdf_Graph') {
    throw new InvalidArgumentException("\$graph should be an EasyRdf_Graph object and cannot be null");
  }
  if ($format == null or $format == '') {
    throw new InvalidArgumentException("\$format cannot be null or empty");
  }
  elseif (is_object($format) and get_class($format) == 'EasyRdf_Format') {
    $format = $format
      ->getName();
  }
  elseif (!is_string($format)) {
    throw new InvalidArgumentException("\$format should be a string or an EasyRdf_Format object");
  }
}