public function NodeResourceFeedModelItem::getDescription in Services 6.3
Same name and namespace in other branches
- 6.2 services/node_service/node_resource.models.inc \NodeResourceFeedModelItem::getDescription()
- 7 services/node_service/node_resource.models.inc \NodeResourceFeedModelItem::getDescription()
Calls node_build_content to create a teaser
Overrides ResourceFeedModelItem::getDescription
File
- servers/
rest_server/ includes/ node_resource.models.inc, line 75 - This file will parse a node resource feed And will also provide the necessary manip functions
Class
Code
public function getDescription() {
$description = '';
if ($this->mode == 'render') {
// Don't bother with the rendering process if only
// the title was requested.
if ($this->item_length != 'title') {
$description = $this
->renderAsNodeFeed($this->node->nid, $this->item_length);
}
}
else {
// Serve the raw teaser or body
switch ($this->item_length) {
case 'teaser':
if (isset($this->node->teaser)) {
$description = $this->node->teaser;
}
break;
case 'fulltext':
if (isset($this->node->body)) {
$description = $this->node->body;
}
break;
}
}
return $description;
}