Mikey
Well-known member
I'm updating a previous plugin from XF1.x to XF2.x for @xenfans
Previously I had this to get a list of Private Nodes - but can't see how I convert this over to XF 2.x
I have the \XF\Entity\Forum and \XF\Entity\Node available to me, but I can't see how to see that a Node/Forum is private from these areas. I see PermissionCacheContent is a thing but I have no idea how to quickly check (as above) if a Node is set as private or not.
Previously I had this to get a list of Private Nodes - but can't see how I convert this over to XF 2.x
Code:
// build our query
$_query = $this->getPrivateNodeQuery();
// get db instance
$db = XenForo_Application::getDb();
// get results
$privateNodes = $db->fetchAll($_query);
// Get forum
$forum = $this->_getForumData();
foreach ($privateNodes as $node) {
// node id is in private node id list?
if ($node['node_id'] === $forum['node_id']) {
// return false
$return = false;
}
}
return $return;
I have the \XF\Entity\Forum and \XF\Entity\Node available to me, but I can't see how to see that a Node/Forum is private from these areas. I see PermissionCacheContent is a thing but I have no idea how to quickly check (as above) if a Node is set as private or not.