Skip to content

Commit 46a0ab1

Browse files
committed
Adding a join over to Permissions for menu items to reduce queries.
1 parent dfd28bc commit 46a0ab1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/model/doctrine/PluginioDoctrineMenuItemTable.class.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ public function persist(ioMenuItem $menu, ioDoctrineMenuItem $parent = null)
107107
public function fetchRootByName($name)
108108
{
109109
return $this->createQuery('m')
110+
->select('m.*')
111+
->leftJoin('m.Permissions p')
112+
->addSelect('p.id, p.name')
110113
->where('m.lft = ?', 1)
111114
->andWhere('m.name = ?', $name)
112115
->fetchOne();

0 commit comments

Comments
 (0)