mirror of
https://github.com/symfony/recipes-contrib.git
synced 2026-09-18 02:26:36 +03:00
Add maps_red/ticketing-bundle recipe
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
ticketing:
|
||||
resource: '@TicketingBundle/Resources/config/routing/routes.yaml'
|
||||
prefix: /ticket
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"bundles": {
|
||||
"Maps_red\\TicketingBundle\\TicketingBundle": ["all"]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<bg=blue;fg=white> </>
|
||||
<bg=blue;fg=white> What's next? </>
|
||||
<bg=blue;fg=white> </>
|
||||
|
||||
Please update config/packages/doctrine.yaml to link the entities correctly.
|
||||
- For this please read the following documentation :
|
||||
* https://github.com/Mapsred/TicketingBundle/blob/master/docs/2-setting_up_the_entities.md#b---fill-the-doctrine-configuration
|
||||
- For a full list of configuration options, see:
|
||||
* https://github.com/Mapsred/TicketingBundle/blob/master/docs/3-setting_up_the_configuration.md
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Maps_red\TicketingBundle\Entity\Ticket as BaseTicket;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass="App\Repository\TicketRepository")
|
||||
*/
|
||||
class Ticket extends BaseTicket
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Maps_red\TicketingBundle\Entity\TicketCategory as BaseTicketCategory;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass="App\Repository\TicketCategoryRepository")
|
||||
*/
|
||||
class TicketCategory extends BaseTicketCategory
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Maps_red\TicketingBundle\Entity\TicketComment as BaseTicketComment;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass="App\Repository\TicketCommentRepository")
|
||||
*/
|
||||
class TicketComment extends BaseTicketComment
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Maps_red\TicketingBundle\Entity\TicketHistory as BaseTicketHistory;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass="App\Repository\TicketHistoryRepository")
|
||||
*/
|
||||
class TicketHistory extends BaseTicketHistory
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Maps_red\TicketingBundle\Entity\TicketKeyword as BaseTicketKeyword;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass="App\Repository\TicketKeywordRepository")
|
||||
*/
|
||||
class TicketKeyword extends BaseTicketKeyword
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Maps_red\TicketingBundle\Entity\TicketPriority as BaseTicketPriority;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass="App\Repository\TicketPriorityRepository")
|
||||
*/
|
||||
class TicketPriority extends BaseTicketPriority
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Maps_red\TicketingBundle\Entity\TicketStatus as BaseTicketStatus;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass="App\Repository\TicketStatusRepository")
|
||||
*/
|
||||
class TicketStatus extends BaseTicketStatus
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Maps_red\TicketingBundle\Entity\TicketStatusHistory as BaseTicketStatusHistory;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass="App\Repository\TicketStatusHistoryRepository")
|
||||
*/
|
||||
class TicketStatusHistory extends BaseTicketStatusHistory
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\TicketCategory;
|
||||
use Symfony\Bridge\Doctrine\RegistryInterface;
|
||||
use Maps_red\TicketingBundle\Repository\TicketCategoryRepository as BaseTicketCategoryRepository;
|
||||
|
||||
/**
|
||||
* @method TicketCategory|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method TicketCategory|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method TicketCategory[] findAll()
|
||||
* @method TicketCategory[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class TicketCategoryRepository extends BaseTicketCategoryRepository
|
||||
{
|
||||
public function __construct(RegistryInterface $registry)
|
||||
{
|
||||
parent::__construct($registry, TicketCategory::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return TicketCategory[] Returns an array of TicketCategory objects
|
||||
// */
|
||||
/*
|
||||
public function findByExampleField($value)
|
||||
{
|
||||
return $this->createQueryBuilder('t')
|
||||
->andWhere('t.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->orderBy('t.id', 'ASC')
|
||||
->setMaxResults(10)
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
public function findOneBySomeField($value): ?TicketCategory
|
||||
{
|
||||
return $this->createQueryBuilder('t')
|
||||
->andWhere('t.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->getQuery()
|
||||
->getOneOrNullResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\TicketComment;
|
||||
use Symfony\Bridge\Doctrine\RegistryInterface;
|
||||
use Maps_red\TicketingBundle\Repository\TicketCommentRepository as BaseTicketCommentRepository;
|
||||
|
||||
/**
|
||||
* @method TicketComment|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method TicketComment|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method TicketComment[] findAll()
|
||||
* @method TicketComment[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class TicketCommentRepository extends BaseTicketCommentRepository
|
||||
{
|
||||
public function __construct(RegistryInterface $registry)
|
||||
{
|
||||
parent::__construct($registry, TicketComment::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return TicketComment[] Returns an array of TicketComment objects
|
||||
// */
|
||||
/*
|
||||
public function findByExampleField($value)
|
||||
{
|
||||
return $this->createQueryBuilder('t')
|
||||
->andWhere('t.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->orderBy('t.id', 'ASC')
|
||||
->setMaxResults(10)
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
public function findOneBySomeField($value): ?TicketComment
|
||||
{
|
||||
return $this->createQueryBuilder('t')
|
||||
->andWhere('t.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->getQuery()
|
||||
->getOneOrNullResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\TicketHistory;
|
||||
use Symfony\Bridge\Doctrine\RegistryInterface;
|
||||
use Maps_red\TicketingBundle\Repository\TicketHistoryRepository as BaseTicketHistoryRepository;
|
||||
|
||||
/**
|
||||
* @method TicketHistory|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method TicketHistory|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method TicketHistory[] findAll()
|
||||
* @method TicketHistory[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class TicketHistoryRepository extends BaseTicketHistoryRepository
|
||||
{
|
||||
public function __construct(RegistryInterface $registry)
|
||||
{
|
||||
parent::__construct($registry, TicketHistory::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return TicketHistory[] Returns an array of TicketHistory objects
|
||||
// */
|
||||
/*
|
||||
public function findByExampleField($value)
|
||||
{
|
||||
return $this->createQueryBuilder('t')
|
||||
->andWhere('t.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->orderBy('t.id', 'ASC')
|
||||
->setMaxResults(10)
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
public function findOneBySomeField($value): ?TicketHistory
|
||||
{
|
||||
return $this->createQueryBuilder('t')
|
||||
->andWhere('t.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->getQuery()
|
||||
->getOneOrNullResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\TicketKeyword;
|
||||
use Symfony\Bridge\Doctrine\RegistryInterface;
|
||||
use Maps_red\TicketingBundle\Repository\TicketKeywordRepository as BaseTicketKeywordRepository;
|
||||
|
||||
/**
|
||||
* @method TicketKeyword|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method TicketKeyword|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method TicketKeyword[] findAll()
|
||||
* @method TicketKeyword[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class TicketKeywordRepository extends BaseTicketKeywordRepository
|
||||
{
|
||||
public function __construct(RegistryInterface $registry)
|
||||
{
|
||||
parent::__construct($registry, TicketKeyword::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return TicketKeyword[] Returns an array of TicketKeyword objects
|
||||
// */
|
||||
/*
|
||||
public function findByExampleField($value)
|
||||
{
|
||||
return $this->createQueryBuilder('t')
|
||||
->andWhere('t.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->orderBy('t.id', 'ASC')
|
||||
->setMaxResults(10)
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
public function findOneBySomeField($value): ?TicketKeyword
|
||||
{
|
||||
return $this->createQueryBuilder('t')
|
||||
->andWhere('t.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->getQuery()
|
||||
->getOneOrNullResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\TicketPriority;
|
||||
use Symfony\Bridge\Doctrine\RegistryInterface;
|
||||
use Maps_red\TicketingBundle\Repository\TicketPriorityRepository as BaseTicketPriorityRepository;
|
||||
|
||||
/**
|
||||
* @method TicketPriority|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method TicketPriority|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method TicketPriority[] findAll()
|
||||
* @method TicketPriority[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class TicketPriorityRepository extends BaseTicketPriorityRepository
|
||||
{
|
||||
public function __construct(RegistryInterface $registry)
|
||||
{
|
||||
parent::__construct($registry, TicketPriority::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return TicketPriority[] Returns an array of TicketPriority objects
|
||||
// */
|
||||
/*
|
||||
public function findByExampleField($value)
|
||||
{
|
||||
return $this->createQueryBuilder('t')
|
||||
->andWhere('t.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->orderBy('t.id', 'ASC')
|
||||
->setMaxResults(10)
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
public function findOneBySomeField($value): ?TicketPriority
|
||||
{
|
||||
return $this->createQueryBuilder('t')
|
||||
->andWhere('t.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->getQuery()
|
||||
->getOneOrNullResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Ticket;
|
||||
use Symfony\Bridge\Doctrine\RegistryInterface;
|
||||
use Maps_red\TicketingBundle\Repository\TicketRepository as BaseTicketRepository;
|
||||
|
||||
/**
|
||||
* @method Ticket|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method Ticket|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method Ticket[] findAll()
|
||||
* @method Ticket[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class TicketRepository extends BaseTicketRepository
|
||||
{
|
||||
public function __construct(RegistryInterface $registry)
|
||||
{
|
||||
parent::__construct($registry, Ticket::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Ticket[] Returns an array of Ticket objects
|
||||
// */
|
||||
/*
|
||||
public function findByExampleField($value)
|
||||
{
|
||||
return $this->createQueryBuilder('t')
|
||||
->andWhere('t.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->orderBy('t.id', 'ASC')
|
||||
->setMaxResults(10)
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
public function findOneBySomeField($value): ?Ticket
|
||||
{
|
||||
return $this->createQueryBuilder('t')
|
||||
->andWhere('t.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->getQuery()
|
||||
->getOneOrNullResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\TicketStatusHistory;
|
||||
use Symfony\Bridge\Doctrine\RegistryInterface;
|
||||
use Maps_red\TicketingBundle\Repository\TicketStatusHistoryRepository as BaseTicketStatusHistoryRepository;
|
||||
|
||||
/**
|
||||
* @method TicketStatusHistory|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method TicketStatusHistory|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method TicketStatusHistory[] findAll()
|
||||
* @method TicketStatusHistory[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class TicketStatusHistoryRepository extends BaseTicketStatusHistoryRepository
|
||||
{
|
||||
public function __construct(RegistryInterface $registry)
|
||||
{
|
||||
parent::__construct($registry, TicketStatusHistory::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return TicketStatusHistory[] Returns an array of TicketStatusHistory objects
|
||||
// */
|
||||
/*
|
||||
public function findByExampleField($value)
|
||||
{
|
||||
return $this->createQueryBuilder('t')
|
||||
->andWhere('t.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->orderBy('t.id', 'ASC')
|
||||
->setMaxResults(10)
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
public function findOneBySomeField($value): ?TicketStatusHistory
|
||||
{
|
||||
return $this->createQueryBuilder('t')
|
||||
->andWhere('t.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->getQuery()
|
||||
->getOneOrNullResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\TicketStatus;
|
||||
use Symfony\Bridge\Doctrine\RegistryInterface;
|
||||
use Maps_red\TicketingBundle\Repository\TicketStatusRepository as BaseTicketStatusRepository;
|
||||
|
||||
/**
|
||||
* @method TicketStatus|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method TicketStatus|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method TicketStatus[] findAll()
|
||||
* @method TicketStatus[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class TicketStatusRepository extends BaseTicketStatusRepository
|
||||
{
|
||||
public function __construct(RegistryInterface $registry)
|
||||
{
|
||||
parent::__construct($registry, TicketStatus::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return TicketStatus[] Returns an array of TicketStatus objects
|
||||
// */
|
||||
/*
|
||||
public function findByExampleField($value)
|
||||
{
|
||||
return $this->createQueryBuilder('t')
|
||||
->andWhere('t.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->orderBy('t.id', 'ASC')
|
||||
->setMaxResults(10)
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
public function findOneBySomeField($value): ?TicketStatus
|
||||
{
|
||||
return $this->createQueryBuilder('t')
|
||||
->andWhere('t.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->getQuery()
|
||||
->getOneOrNullResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\User;
|
||||
use Maps_red\TicketingBundle\Repository\UserRepository as BaseTicketRepository;
|
||||
use Symfony\Bridge\Doctrine\RegistryInterface;
|
||||
use Symfony\Bridge\Doctrine\Security\User\UserLoaderInterface;
|
||||
|
||||
|
||||
/**
|
||||
* Class UserRepository
|
||||
*
|
||||
* @author François MATHIEU <francois.mathieu@livexp.fr>
|
||||
* @method User|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method User|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method User[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class UserRepository extends BaseTicketRepository implements UserLoaderInterface
|
||||
{
|
||||
/**
|
||||
* UserRepository constructor.
|
||||
* @param RegistryInterface $registry
|
||||
*/
|
||||
public function __construct(RegistryInterface $registry)
|
||||
{
|
||||
parent::__construct($registry, User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $username
|
||||
* @return null|User
|
||||
*/
|
||||
public function loadUserByUsername($username)
|
||||
{
|
||||
return $this->findByUsernameOrEmail($username);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $username
|
||||
* @return User|null
|
||||
*/
|
||||
public function findByUsernameOrEmail($username)
|
||||
{
|
||||
return $this->createQueryBuilder('u')
|
||||
->andWhere('UPPER(u.username) = :username OR UPPER(u.email) = :username')
|
||||
->setParameter('username', strtoupper($username))
|
||||
->setMaxResults(1)
|
||||
->getQuery()
|
||||
->getOneOrNullResult();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user