You are here

protected function EasyRdf_Graph::arrayToObject in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/easyrdf/easyrdf/lib/EasyRdf/Graph.php \EasyRdf_Graph::arrayToObject()

Get an EasyRdf_Resource or EasyRdf_Literal object from an associative array. @ignore

2 calls to EasyRdf_Graph::arrayToObject()
EasyRdf_Graph::allForSingleProperty in vendor/easyrdf/easyrdf/lib/EasyRdf/Graph.php
Get all values for a single property of a resource
EasyRdf_Graph::getSingleProperty in vendor/easyrdf/easyrdf/lib/EasyRdf/Graph.php
Get a single value for a property of a resource

File

vendor/easyrdf/easyrdf/lib/EasyRdf/Graph.php, line 720

Class

EasyRdf_Graph
Container for collection of EasyRdf_Resources.

Code

protected function arrayToObject($data) {
  if ($data) {
    if ($data['type'] == 'uri' or $data['type'] == 'bnode') {
      return $this
        ->resource($data['value']);
    }
    else {
      return EasyRdf_Literal::create($data);
    }
  }
  else {
    return null;
  }
}