Example #1
0
 /**
  * Override the behavior of title(). Get the title of the node.
  */
 public function titleQuery()
 {
     $titles = array();
     $nodes = $this->nodeStorage->loadMultiple($this->value);
     foreach ($nodes as $node) {
         $titles[] = SafeMarkup::checkPlain($node->label());
     }
     return $titles;
 }
Example #2
0
 public function preRender($values)
 {
     $nids = array();
     foreach ($values as $row) {
         $nids[] = $row->{$this->field_alias};
     }
     if (!empty($nids)) {
         $this->nodes = $this->nodeStorage->loadMultiple($nids);
     }
 }
Example #3
0
 /**
  * Override the behavior of title(). Get the title of the revision.
  */
 public function titleQuery()
 {
     $titles = array();
     $results = $this->database->query('SELECT nr.vid, nr.nid, npr.title FROM {node_revision} nr WHERE nr.vid IN ( :vids[] )', array(':vids[]' => $this->value))->fetchAllAssoc('vid', PDO::FETCH_ASSOC);
     $nids = array();
     foreach ($results as $result) {
         $nids[] = $result['nid'];
     }
     $nodes = $this->nodeStorage->loadMultiple(array_unique($nids));
     foreach ($results as $result) {
         $nodes[$result['nid']]->set('title', $result['title']);
         $titles[] = String::checkPlain($nodes[$result['nid']]->label());
     }
     return $titles;
 }