public function getNodeById($id, $published)
    {
        return $published ? PublishedNode::find($id) : Node::find($id);
    }
public function getNodeById($id, $published)
    {
        return $published ? PublishedNode::find($id) : Node::find($id);
    }
public function getNodeById ( $ id , $ published ) { return $ published ? PublishedNode :: find ( $ id ) : Node :: find ( $ id ) ; }
Returns a node by id

@param int $id
@param bool $published
@return Node
Returns a node by id