Skip to content

Commit 49e975c

Browse files
committed
feat: use fetchTable for Users and remove shells
1 parent eee5845 commit 49e975c

6 files changed

Lines changed: 4 additions & 190 deletions

File tree

src/Controller/AtagsController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ public function index()
6666

6767
// si user filter tags ajout des tags de l'utilisateur
6868
if(!empty(Configure::read('Trois/Attachment.browse.user_filter_tag_types'))){
69-
$this->loadModel('Users');
69+
$usersTable = $this->fetchTable('Users');
7070
$id = $this->getRequest()->getSession()->read('Auth')->id;
71-
$user = $this->Users->get($id, ['contain' => ['Atags']]);
71+
$user = $usersTable->get($id, ['contain' => ['Atags']]);
7272
$tagsIds = [];
7373
if(!empty($user->atags))
7474
{

src/Controller/AttachmentsController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ public function index()
9292
if(empty($this->request->getQuery('uuid'))) throw new UnauthorizedException(__d('Trois/Attachment','Missing uuid'));
9393
$this->Crud->on('beforePaginate', function (Event $event) {
9494
if(!empty(Configure::read('Trois/Attachment.browse.user_filter_tag_types'))){
95-
$this->loadModel('Users');
95+
$usersTable = $this->fetchTable('Users');
9696
$id = $this->getRequest()->getSession()->read('Auth')->id;
97-
$user = $this->Users->get($id, ['contain' => ['Atags']]);
97+
$user = $usersTable->get($id, ['contain' => ['Atags']]);
9898
$tagsIds = [];
9999
if(!empty($user->atags))
100100
{

src/Shell/CdnShell.php

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/Shell/CreateMissingTranslationsShell.php

Lines changed: 0 additions & 69 deletions
This file was deleted.

src/Shell/GetImageSizesShell.php

Lines changed: 0 additions & 68 deletions
This file was deleted.

src/Shell/Task/ClearTask.php

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)