You are here

class NodeResourceFeedModel in Services 7

Same name and namespace in other branches
  1. 6.3 servers/rest_server/includes/node_resource.models.inc \NodeResourceFeedModel
  2. 6.2 services/node_service/node_resource.models.inc \NodeResourceFeedModel

Hierarchy

Expanded class hierarchy of NodeResourceFeedModel

1 string reference to 'NodeResourceFeedModel'
node_resource_service_resource in services/node_service/node_resource.module

File

services/node_service/node_resource.models.inc, line 3

View source
class NodeResourceFeedModel implements ResourceTimeFeedModel {
  protected $nodes = NULL;
  public function __construct($data) {
    $this->nodes = $data;
  }
  public function current() {
    $node = current($this->nodes);
    if ($node !== FALSE) {
      return new NodeResourceFeedModelItem($node);
    }
    return FALSE;
  }
  public function key() {
    return key($this->nodes);
  }
  public function next() {
    next($this->nodes);
  }
  public function rewind() {
    reset($this->nodes);
  }
  public function valid() {

    // It's safe to use current as there never should be a boolean
    // in the node array.
    return current($this->nodes) !== FALSE;
  }

}

Members