mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-04-01 01:25:39 +00:00
update page form dependencies #19
This commit is contained in:
parent
8df29ef605
commit
c0cc029350
22 changed files with 1049 additions and 102 deletions
47
src/Repository/ActivityRepository.php
Normal file
47
src/Repository/ActivityRepository.php
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Activity;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<Activity>
|
||||
*
|
||||
* @method Activity|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method Activity|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method Activity[] findAll()
|
||||
* @method Activity[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class ActivityRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Activity::class);
|
||||
}
|
||||
|
||||
public function findLast(int $start = 0, int $limit = 10): array
|
||||
{
|
||||
return $this->createQueryBuilder('a')
|
||||
->orderBy('a.id', 'DESC') // same to a.added
|
||||
->setFirstResult($start)
|
||||
->setMaxResults($limit)
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
|
||||
public function findLastByApprovedField(bool $approved, int $start = 0, int $limit = 10): array
|
||||
{
|
||||
return $this->createQueryBuilder('a')
|
||||
->orderBy('a.id', 'DESC') // same to a.added
|
||||
->where('a.approved = :approved')
|
||||
->setParameter('approved', $approved)
|
||||
->setFirstResult($start)
|
||||
->setMaxResults($limit)
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
}
|
||||
23
src/Repository/PageDescriptionRepository.php
Normal file
23
src/Repository/PageDescriptionRepository.php
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\PageDescription;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<PageDescription>
|
||||
*
|
||||
* @method PageDescription|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method PageDescription|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method PageDescription[] findAll()
|
||||
* @method PageDescription[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class PageDescriptionRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, PageDescription::class);
|
||||
}
|
||||
}
|
||||
|
|
@ -20,29 +20,4 @@ class PageRepository extends ServiceEntityRepository
|
|||
{
|
||||
parent::__construct($registry, Page::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Page[] Returns an array of Page objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('p')
|
||||
// ->andWhere('p.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('p.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?Page
|
||||
// {
|
||||
// return $this->createQueryBuilder('p')
|
||||
// ->andWhere('p.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
||||
|
|
|
|||
23
src/Repository/PageSensitiveRepository.php
Normal file
23
src/Repository/PageSensitiveRepository.php
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\PageSensitive;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<PageSensitive>
|
||||
*
|
||||
* @method PageSensitive|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method PageSensitive|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method PageSensitive[] findAll()
|
||||
* @method PageSensitive[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class PageSensitiveRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, PageSensitive::class);
|
||||
}
|
||||
}
|
||||
23
src/Repository/PageTitleRepository.php
Normal file
23
src/Repository/PageTitleRepository.php
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\PageTitle;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<PageTitle>
|
||||
*
|
||||
* @method PageTitle|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method PageTitle|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method PageTitle[] findAll()
|
||||
* @method PageTitle[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class PageTitleRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, PageTitle::class);
|
||||
}
|
||||
}
|
||||
23
src/Repository/PageTorrentsRepository.php
Normal file
23
src/Repository/PageTorrentsRepository.php
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\PageTorrents;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<PageTorrents>
|
||||
*
|
||||
* @method PageTorrents|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method PageTorrents|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method PageTorrents[] findAll()
|
||||
* @method PageTorrents[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class PageTorrentsRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, PageTorrents::class);
|
||||
}
|
||||
}
|
||||
|
|
@ -40,13 +40,4 @@ class UserRepository extends ServiceEntityRepository
|
|||
->getOneOrNullResult()
|
||||
;
|
||||
}
|
||||
|
||||
public function findAllByAddedFieldDesc(): array
|
||||
{
|
||||
return $this->createQueryBuilder('u')
|
||||
->orderBy('u.added', 'DESC')
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue