You are here

class NodeResourceFeedModelItem in Services 7

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

Hierarchy

Expanded class hierarchy of NodeResourceFeedModelItem

File

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

View source
class NodeResourceFeedModelItem implements ResourceTimeFeedModelItem {
  protected $node = NULL;
  public function __construct($data) {
    $this->node = $data;
  }

  /**
   * Returns the raw node title
   *
   * @return string
   *  The title of the node
   */
  public function getName() {
    return $this->node->title;
  }

  /**
   * Calls node_build_content to create a teaser
   */
  public function getDescription() {
    if (!isset($this->node->content)) {
      $this->node = node_build_content($this->node, TRUE, FALSE);
    }
    return $this->node->teaser;
  }

  /**
   * Returns the absolute url to the node
   *
   * @return string
   *  The node url
   */
  public function getUrl() {
    return url('node/' . $this->node->nid, array(
      'absolute' => TRUE,
    ));
  }

  /**
   * Gets the created time for the node
   *
   * @return int
   *  The created time of the node as a timestamp
   */
  public function getCreated() {
    return $this->node->created;
  }

  /**
   * Gets the created time for the node
   *
   * @return int
   *  The created time of the node as a timestamp
   */
  public function getStarts() {
    return $this->node->created;
  }

  /**
   * Gets the created time for the node
   *
   * @return int
   *  The created time of the node as a timestamp
   */
  public function getEnds() {
    return $this->node->created;
  }

  /**
   * Gets a associative array containing extra properties for the item.
   *
   * @return array
   *  The extra properties of the item as an array
   */
  public function getProperties() {
    return get_object_vars($this->node);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
NodeResourceFeedModelItem::$node protected property
NodeResourceFeedModelItem::getCreated public function Gets the created time for the node
NodeResourceFeedModelItem::getDescription public function Calls node_build_content to create a teaser
NodeResourceFeedModelItem::getEnds public function Gets the created time for the node
NodeResourceFeedModelItem::getName public function Returns the raw node title
NodeResourceFeedModelItem::getProperties public function Gets a associative array containing extra properties for the item.
NodeResourceFeedModelItem::getStarts public function Gets the created time for the node
NodeResourceFeedModelItem::getUrl public function Returns the absolute url to the node
NodeResourceFeedModelItem::__construct public function