public function EasyRdf_Literal::toArray

Returns the properties of the literal as an associative array

For example: array('type' => 'literal', 'value' => 'string value')

Return value

array The properties of the literal

File

drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Literal.php, line 278

Class

EasyRdf_Literal
Class that represents an RDF Literal

Code

public function toArray() {
  $array = array(
    'type' => 'literal',
    'value' => $this->value,
  );
  if ($this->datatype) {
    $array['datatype'] = $this->datatype;
  }
  if ($this->lang) {
    $array['lang'] = $this->lang;
  }
  return $array;
}