class NodeResourceFeedModelItem in Services 6.2
Same name and namespace in other branches
- 6.3 servers/rest_server/includes/node_resource.models.inc \NodeResourceFeedModelItem
- 7 services/node_service/node_resource.models.inc \NodeResourceFeedModelItem
Hierarchy
- class \NodeResourceFeedModelItem implements ResourceTimeFeedModelItem
Expanded class hierarchy of NodeResourceFeedModelItem
File
- services/
node_service/ node_resource.models.inc, line 42 - CRUD resource functionality for nodes.
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);
}
}