Beispiel #1
0
 /**
  * Gets or finds the node and sets by id
  *
  * @param int $id
  * @param bool $published
  * @return Node
  */
 public function getOrFind($id, $published = true)
 {
     $node = $this->get($id);
     if (is_null($node)) {
         $node = $published ? PublishedNode::find($id) : Node::find($id);
         $this->put($id, $node);
     }
     return $node;
 }
 /**
  * Returns a node by id
  *
  * @param int $id
  * @param bool $published
  * @return Node
  */
 public function getNodeById($id, $published)
 {
     return $published ? PublishedNode::find($id) : Node::find($id);
 }