Refactored Store.

This commit is contained in:
Dmitry Khomutov 2018-03-04 14:30:34 +07:00
commit 8b5a874789
No known key found for this signature in database
GPG key ID: EC19426474B37AAC
44 changed files with 397 additions and 424 deletions

View file

@ -8,6 +8,7 @@ use PHPCensor\Controller;
use PHPCensor\Model\ProjectGroup;
use PHPCensor\Helper\Lang;
use PHPCensor\Model\User;
use PHPCensor\Store\Factory;
/**
* Project Controller - Allows users to create, edit and view projects.
@ -26,7 +27,7 @@ class GroupController extends Controller
*/
public function init()
{
$this->groupStore = b8\Store\Factory::getStore('ProjectGroup');
$this->groupStore = Factory::getStore('ProjectGroup');
}
/**
@ -44,8 +45,8 @@ class GroupController extends Controller
'title' => $group->getTitle(),
'id' => $group->getId(),
];
$projects_active = b8\Store\Factory::getStore('Project')->getByGroupId($group->getId(), false);
$projects_archived = b8\Store\Factory::getStore('Project')->getByGroupId($group->getId(), true);
$projects_active = Factory::getStore('Project')->getByGroupId($group->getId(), false);
$projects_archived = Factory::getStore('Project')->getByGroupId($group->getId(), true);
$thisGroup['projects'] = array_merge($projects_active['items'], $projects_archived['items']);
$groups[] = $thisGroup;