init
This commit is contained in:
15
src/Repository/CategoryRepository.php
Normal file
15
src/Repository/CategoryRepository.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Category;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Common\Persistence\ManagerRegistry;
|
||||
|
||||
class CategoryRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Category::class);
|
||||
}
|
||||
}
|
15
src/Repository/ConfigRepository.php
Normal file
15
src/Repository/ConfigRepository.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Config;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Common\Persistence\ManagerRegistry;
|
||||
|
||||
class ConfigRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Config::class);
|
||||
}
|
||||
}
|
35
src/Repository/CronRepository.php
Normal file
35
src/Repository/CronRepository.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Cron;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Common\Persistence\ManagerRegistry;
|
||||
|
||||
class CronRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Cron::class);
|
||||
}
|
||||
|
||||
public function toExec()
|
||||
{
|
||||
// Les commandes à executer
|
||||
// = statut = 0 (à executer)
|
||||
// = statut = 2 (OK) et derniere execution + interval > now et nombre d'appel = 0
|
||||
// = statut = 3 (KO) et derniere execution + interval > now et nombre d'appel = 0
|
||||
// = statut = 3 (KO) et nombre d'execution < nombre d'appel
|
||||
|
||||
|
||||
$now=new \DateTime();
|
||||
|
||||
$qb = $this->createQueryBuilder('cron')
|
||||
->Where('cron.statut=0')
|
||||
->orWhere('cron.statut=2 AND cron.nextexecdate<:now AND cron.repeatcall=0')
|
||||
->orWhere('cron.statut=3 AND cron.nextexecdate<:now AND cron.repeatcall=0')
|
||||
->orWhere('cron.statut=3 AND cron.nextexecdate<:now AND cron.repeatcall>cron.repeatexec');
|
||||
|
||||
return $qb->getQuery()->setParameter('now',$now->format("Y-m-d H:i:s"))->getResult();
|
||||
}
|
||||
}
|
15
src/Repository/GroupRepository.php
Normal file
15
src/Repository/GroupRepository.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Group;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Common\Persistence\ManagerRegistry;
|
||||
|
||||
class GroupRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Group::class);
|
||||
}
|
||||
}
|
15
src/Repository/IllustrationRepository.php
Normal file
15
src/Repository/IllustrationRepository.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Illustration;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Common\Persistence\ManagerRegistry;
|
||||
|
||||
class IllustrationRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Illustration::class);
|
||||
}
|
||||
}
|
15
src/Repository/LinkRepository.php
Normal file
15
src/Repository/LinkRepository.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Link;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Common\Persistence\ManagerRegistry;
|
||||
|
||||
class LinkRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Link::class);
|
||||
}
|
||||
}
|
15
src/Repository/ScriptRepository.php
Normal file
15
src/Repository/ScriptRepository.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Script;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Common\Persistence\ManagerRegistry;
|
||||
|
||||
class ScriptRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Script::class);
|
||||
}
|
||||
}
|
15
src/Repository/UserRepository.php
Normal file
15
src/Repository/UserRepository.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\User;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Common\Persistence\ManagerRegistry;
|
||||
|
||||
class UserRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, User::class);
|
||||
}
|
||||
}
|
16
src/Repository/WebzineRepository.php
Normal file
16
src/Repository/WebzineRepository.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Webzine;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Common\Persistence\ManagerRegistry;
|
||||
|
||||
class WebzineRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Webzine::class);
|
||||
}
|
||||
|
||||
}
|
15
src/Repository/WebzinepageRepository.php
Normal file
15
src/Repository/WebzinepageRepository.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Webzinepage;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Common\Persistence\ManagerRegistry;
|
||||
|
||||
class WebzinepageRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Webzinepage::class);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user