Commit 99daf3ee authored by Jens Jacobsen's avatar Jens Jacobsen

Remove unused class (see f985f253)

parent 09a70acf
Pipeline #959 passed with stages
in 4 minutes and 8 seconds
<?php
namespace T3o\TerFe2\Domain\Repository;
class FrontendUserRepository extends \TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository
{
/**
* Find an Object using the UID of the current fe_user
* @return \TYPO3\CMS\Extbase\Domain\Model\FrontendUser the current fe_user or null if none
*/
public function findCurrent()
{
$fe_user = $GLOBALS['TSFE']->fe_user->user;
if (!empty($fe_user)) {
$query = $this->createQuery();
$query->matching($query->equals('uid', intval($fe_user['uid'])));
return $query->execute()->getFirst();
}
return null;
}
/**
* Find an Object using the UID of the current fe_user
* @return \TYPO3\CMS\Extbase\Domain\Model\FrontendUser
*/
public function findOneByForgotHashAndEmail($forgotHash, $email)
{
$query = $this->createQuery();
$constraints = array(
$query->equals('forgotHash', $forgotHash),
$query->equals('email', $email),
// check for validity is done in controller to have better error messages
//$query->greaterThan('forgotHashValid', time())
);
$query->matching($query->logicalAnd($constraints));
return $query->execute()->getFirst();
}
/**
* Find an Object using the UID of the current fe_user
* @return \TYPO3\CMS\Extbase\Domain\Model\FrontendUser
*/
public function findOneByVerificationHashAndEmail($verificationHash, $email)
{
$query = $this->createQuery();
$query->getQuerySettings()->setRespectEnableFields(FALSE);
$constraints = array(
$query->equals('deleted', 0),
$query->equals('verificationHash', $verificationHash),
$query->equals('email', $email)
);
$query->matching($query->logicalAnd($constraints));
return $query->execute()->getFirst();
}
/**
* @return \TYPO3\CMS\Extbase\Domain\Model\FrontendUser
*/
public function findOneByEmail($email)
{
$query = $this->createQuery();
$query->getQuerySettings()->setRespectEnableFields(FALSE);
$constraints = array(
$query->equals('deleted', 0),
$query->equals('email', $email)
);
$query->matching($query->logicalAnd($constraints));
return $query->execute()->getFirst();
}
/**
* @return \TYPO3\CMS\Extbase\Domain\Model\FrontendUser
*/
public function findOneByUsername($username)
{
$query = $this->createQuery();
$query->getQuerySettings()->setRespectEnableFields(FALSE);
$query->getQuerySettings()->setRespectStoragePage(FALSE);
$constraints = array(
$query->equals('deleted', 0),
$query->equals('username', $username)
);
$query->matching($query->logicalAnd($constraints));
return $query->execute()->getFirst();
}
/**
* Find an Object using the UID of the current fe_user
* @return \TYPO3\CMS\Extbase\Domain\Model\FrontendUser
*/
public function findOneByEnableHash($enableHash)
{
$query = $this->createQuery();
$constraints = array(
$query->equals('enableHash', $enableHash),
$query->equals('disable', 0)
);
$query->matching($query->logicalAnd($constraints));
return $query->execute()->getFirst();
}
/**
* Find all users which not approved yet.
*
* @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
*/
public function findAllToApprove()
{
$query = $this->createQuery();
$query->getQuerySettings()->setRespectEnableFields(FALSE);
$query->getQuerySettings()->setRespectStoragePage(FALSE);
$constraints = array(
$query->equals('deleted', 0),
$query->equals('disable', 1),
$query->equals('verificationHash', ''),
$query->equals('newUser', 1)
);
$query->matching($query->logicalAnd($constraints));
return $query->execute();
}
/**
* @param $uid
*
* @return \TYPO3\CMS\Extbase\Domain\Model\FrontendUser
*/
public function findUserByUid($uid)
{
$query = $this->createQuery();
$query->getQuerySettings()->setRespectEnableFields(FALSE);
$query->getQuerySettings()->setRespectStoragePage(FALSE);
$query->matching($query->equals('uid', $uid));
return $query->execute()->getFirst();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment