MyProfileRepository.php 731 Bytes
Newer Older
1
2
3
4
5
6
7
8
<?php
declare(strict_types=1);
namespace T3o\T3omy\Domain\Repository;

use TYPO3\CMS\Extbase\Persistence\Repository;

/**
 * Class UserProfileRepository
9
10
 *
 * @method findByUid(int $uid) \T3o\T3omy\Domain\Model\MyProfile
11
12
13
14
 */
class MyProfileRepository extends Repository
{

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
    /**
     * @param int $uid
     * @return \T3o\T3omy\Domain\Model\MyProfile|object
     */
    public function findDisabledByUid(int $uid)
    {
        $query = $this->createQuery();
        $query->getQuerySettings()
            ->setIgnoreEnableFields(true)
            ->setEnableFieldsToBeIgnored(['disable'])
            ->setRespectStoragePage(false);

        return $query->matching($query->equals('uid', $uid))->execute()->getFirst();
    }

30
}