You are here

public function EasyRdf_Container::append in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/easyrdf/easyrdf/lib/EasyRdf/Container.php \EasyRdf_Container::append()

Append an item to the end of the container

Parameters

mixed $value The value to append:

Return value

integer The number of values appended (1 or 0)

1 call to EasyRdf_Container::append()
EasyRdf_Container::offsetSet in vendor/easyrdf/easyrdf/lib/EasyRdf/Container.php
Array Access: set an item at a positon in container using array syntax

File

vendor/easyrdf/easyrdf/lib/EasyRdf/Container.php, line 151

Class

EasyRdf_Container
Sub-class of EasyRdf_Resource that represents an RDF container (rdf:Alt, rdf:Bag and rdf:Seq)

Code

public function append($value) {

  // Find the end of the list
  $pos = 1;
  while ($this
    ->hasProperty('rdf:_' . $pos)) {
    $pos++;
  }

  // Add the item
  return $this
    ->add('rdf:_' . $pos, $value);
}