<?php | |||||
declare(strict_types=1); | |||||
namespace DoctrineMigrations; | |||||
use Doctrine\DBAL\Schema\Schema; | |||||
use Doctrine\Migrations\AbstractMigration; | |||||
/** | |||||
* Auto-generated Migration: Please modify to your needs! | |||||
*/ | |||||
final class Version20210826134725 extends AbstractMigration | |||||
{ | |||||
public function getDescription(): string | |||||
{ | |||||
return ''; | |||||
} | |||||
public function up(Schema $schema): void | |||||
{ | |||||
// this up() migration is auto-generated, please modify it to your needs | |||||
$this->addSql('CREATE TABLE subthematic (id INT AUTO_INCREMENT NOT NULL, thematic_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, INDEX IDX_778C62FB2395FCED (thematic_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); | |||||
$this->addSql('ALTER TABLE subthematic ADD CONSTRAINT FK_778C62FB2395FCED FOREIGN KEY (thematic_id) REFERENCES thematic (id)'); | |||||
} | |||||
public function down(Schema $schema): void | |||||
{ | |||||
// this down() migration is auto-generated, please modify it to your needs | |||||
$this->addSql('DROP TABLE subthematic'); | |||||
} | |||||
} |
<?php | |||||
declare(strict_types=1); | |||||
namespace DoctrineMigrations; | |||||
use Doctrine\DBAL\Schema\Schema; | |||||
use Doctrine\Migrations\AbstractMigration; | |||||
/** | |||||
* Auto-generated Migration: Please modify to your needs! | |||||
*/ | |||||
final class Version20210826144820 extends AbstractMigration | |||||
{ | |||||
public function getDescription(): string | |||||
{ | |||||
return ''; | |||||
} | |||||
public function up(Schema $schema): void | |||||
{ | |||||
// this up() migration is auto-generated, please modify it to your needs | |||||
$this->addSql('ALTER TABLE individual_data DROP email, DROP intro_question, DROP intro_answer'); | |||||
} | |||||
public function down(Schema $schema): void | |||||
{ | |||||
// this down() migration is auto-generated, please modify it to your needs | |||||
$this->addSql('ALTER TABLE individual_data ADD email VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, ADD intro_question VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, ADD intro_answer VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`'); | |||||
} | |||||
} |
<?php | |||||
declare(strict_types=1); | |||||
namespace DoctrineMigrations; | |||||
use Doctrine\DBAL\Schema\Schema; | |||||
use Doctrine\Migrations\AbstractMigration; | |||||
/** | |||||
* Auto-generated Migration: Please modify to your needs! | |||||
*/ | |||||
final class Version20210826145431 extends AbstractMigration | |||||
{ | |||||
public function getDescription(): string | |||||
{ | |||||
return ''; | |||||
} | |||||
public function up(Schema $schema): void | |||||
{ | |||||
// this up() migration is auto-generated, please modify it to your needs | |||||
$this->addSql('ALTER TABLE individual_data ADD email VARCHAR(255) NOT NULL, ADD intro_question VARCHAR(255) NOT NULL, ADD intro_answer VARCHAR(255) DEFAULT NULL'); | |||||
} | |||||
public function down(Schema $schema): void | |||||
{ | |||||
// this down() migration is auto-generated, please modify it to your needs | |||||
$this->addSql('ALTER TABLE individual_data DROP email, DROP intro_question, DROP intro_answer'); | |||||
} | |||||
} |
<?php | |||||
declare(strict_types=1); | |||||
namespace DoctrineMigrations; | |||||
use Doctrine\DBAL\Schema\Schema; | |||||
use Doctrine\Migrations\AbstractMigration; | |||||
/** | |||||
* Auto-generated Migration: Please modify to your needs! | |||||
*/ | |||||
final class Version20210826151431 extends AbstractMigration | |||||
{ | |||||
public function getDescription(): string | |||||
{ | |||||
return ''; | |||||
} | |||||
public function up(Schema $schema): void | |||||
{ | |||||
// this up() migration is auto-generated, please modify it to your needs | |||||
$this->addSql('ALTER TABLE individual_data CHANGE firstname firstname VARCHAR(255) DEFAULT NULL, CHANGE lastname lastname VARCHAR(255) DEFAULT NULL, CHANGE email email VARCHAR(255) DEFAULT NULL, CHANGE intro_question intro_question VARCHAR(255) DEFAULT NULL'); | |||||
} | |||||
public function down(Schema $schema): void | |||||
{ | |||||
// this down() migration is auto-generated, please modify it to your needs | |||||
$this->addSql('ALTER TABLE individual_data CHANGE firstname firstname VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE lastname lastname VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE email email VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE intro_question intro_question VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`'); | |||||
} | |||||
} |
use App\Entity\ProjectInspiring; | use App\Entity\ProjectInspiring; | ||||
use App\Entity\Revolt; | use App\Entity\Revolt; | ||||
use App\Entity\Site\Page; | use App\Entity\Site\Page; | ||||
use App\Entity\Subthematic; | |||||
use App\Entity\Territory; | use App\Entity\Territory; | ||||
use App\Entity\Thematic; | use App\Entity\Thematic; | ||||
use App\Entity\User\User; | use App\Entity\User\User; | ||||
$animators = $repoUser->findByRole(self::ROLE_ANIMATOR); | $animators = $repoUser->findByRole(self::ROLE_ANIMATOR); | ||||
return $this->render('/adminlte/dashboard.html.twig', | |||||
return $this->render( | |||||
'/adminlte/dashboard.html.twig', | |||||
[ | [ | ||||
'nbFormUnvalid' => count($formUnvalid), | 'nbFormUnvalid' => count($formUnvalid), | ||||
'nbFormValid' => count($formValid), | 'nbFormValid' => count($formValid), | ||||
'nbProjectBoost' => count($projectBoost), | 'nbProjectBoost' => count($projectBoost), | ||||
'nbProjectsInsp' => count($projectsInsp), | 'nbProjectsInsp' => count($projectsInsp), | ||||
'nbAnimator' => count($animators) | 'nbAnimator' => count($animators) | ||||
]); | |||||
] | |||||
); | |||||
} | } | ||||
public function configureAssets(): Assets | public function configureAssets(): Assets | ||||
$urlNewCollectif = $this->adminUrlGenerator | $urlNewCollectif = $this->adminUrlGenerator | ||||
->setController(CollectifDataCrudController::class) | ->setController(CollectifDataCrudController::class) | ||||
->setAction(Action::NEW) | ->setAction(Action::NEW) | ||||
->set('menuIndex', 3) | |||||
->set('menuIndex', 4) | |||||
->set('submenuIndex', 0) | ->set('submenuIndex', 0) | ||||
->generateUrl(); | ->generateUrl(); | ||||
->setController(CollectifDataCrudController::class) | ->setController(CollectifDataCrudController::class) | ||||
->setAction(Action::INDEX) | ->setAction(Action::INDEX) | ||||
->set('status', 1) | ->set('status', 1) | ||||
->set('menuIndex', 3) | |||||
->set('menuIndex', 4) | |||||
->set('submenuIndex', 2) | ->set('submenuIndex', 2) | ||||
->generateUrl(); | ->generateUrl(); | ||||
->setController(CollectifDataCrudController::class) | ->setController(CollectifDataCrudController::class) | ||||
->setAction(Action::INDEX) | ->setAction(Action::INDEX) | ||||
->set('status', 0) | ->set('status', 0) | ||||
->set('menuIndex', 3) | |||||
->set('menuIndex', 4) | |||||
->set('submenuIndex', 1) | ->set('submenuIndex', 1) | ||||
->generateUrl(); | ->generateUrl(); | ||||
$urlNewIndividuel = $this->adminUrlGenerator | |||||
->setController(IndividualDataCrudController::class) | |||||
->setAction(Action::NEW) | |||||
->set('menuIndex', 3) | |||||
->set('submenuIndex', 0) | |||||
->generateUrl(); | |||||
$urlOnlineIndividuel = $this->adminUrlGenerator | $urlOnlineIndividuel = $this->adminUrlGenerator | ||||
->setController(IndividualDataCrudController::class) | ->setController(IndividualDataCrudController::class) | ||||
->setAction(Action::INDEX) | ->setAction(Action::INDEX) | ||||
->set('status', 1) | ->set('status', 1) | ||||
->set('menuIndex', 3) | ->set('menuIndex', 3) | ||||
->set('submenuIndex', 1) | |||||
->set('submenuIndex', 2) | |||||
->generateUrl(); | ->generateUrl(); | ||||
$urlOfflineIndividuel = $this->adminUrlGenerator | $urlOfflineIndividuel = $this->adminUrlGenerator | ||||
->setAction(Action::INDEX) | ->setAction(Action::INDEX) | ||||
->set('status', 0) | ->set('status', 0) | ||||
->set('menuIndex', 3) | ->set('menuIndex', 3) | ||||
->set('submenuIndex', 0) | |||||
->set('submenuIndex', 1) | |||||
->generateUrl(); | ->generateUrl(); | ||||
$menuItems = [ | $menuItems = [ | ||||
), | ), | ||||
MenuItem::linkToCrud('user', 'fas fa-users', User::class) | MenuItem::linkToCrud('user', 'fas fa-users', User::class) | ||||
->setPermission(self::ROLE_ADMIN), | ->setPermission(self::ROLE_ADMIN), | ||||
/*MenuItem::subMenu('data_individual', 'user') | |||||
MenuItem::subMenu('data_individual', 'fas fa-database') | |||||
->setPermission(self::ROLE_ADMIN) | ->setPermission(self::ROLE_ADMIN) | ||||
->setSubItems( | ->setSubItems( | ||||
[ | [ | ||||
MenuItem::linkToUrl('data_individual_waiting', '', $urlOfflineIndividuel), | |||||
MenuItem::linkToUrl('data_individual_validate', '', $urlOnlineIndividuel), | |||||
MenuItem::linkToUrl('data_individual_new', 'fas fa-plus', $urlNewIndividuel), | |||||
MenuItem::linkToUrl('data_individual_waiting', 'fas fa-hourglass-half', $urlOfflineIndividuel), | |||||
MenuItem::linkToUrl('data_individual_validate', 'fas fa-check', $urlOnlineIndividuel), | |||||
] | ] | ||||
),*/ | |||||
), | |||||
MenuItem::subMenu('data_collectif', 'fas fa-database') | MenuItem::subMenu('data_collectif', 'fas fa-database') | ||||
->setPermission(self::ROLE_ADMIN) | ->setPermission(self::ROLE_ADMIN) | ||||
->setSubItems( | ->setSubItems( | ||||
), | ), | ||||
MenuItem::linkToCrud('thematic', 'fas fa-book', Thematic::class) | MenuItem::linkToCrud('thematic', 'fas fa-book', Thematic::class) | ||||
->setPermission(self::ROLE_ADMIN), | ->setPermission(self::ROLE_ADMIN), | ||||
MenuItem::linkToCrud('subthematic', 'fas fa-book', Subthematic::class) | |||||
->setPermission(self::ROLE_ADMIN), | |||||
MenuItem::linkToCrud('territory', 'far fa-copy', Territory::class) | MenuItem::linkToCrud('territory', 'far fa-copy', Territory::class) | ||||
->setPermission(self::ROLE_SUPER_ADMIN), | ->setPermission(self::ROLE_SUPER_ADMIN), | ||||
MenuItem::linkToCrud('configuration', 'far fa-copy', Configuration::class) | MenuItem::linkToCrud('configuration', 'far fa-copy', Configuration::class) |
use App\Entity\Configuration; | use App\Entity\Configuration; | ||||
use App\Entity\IndividualData; | use App\Entity\IndividualData; | ||||
use App\Type\DreamType; | |||||
use App\Type\ProjectBoostType; | |||||
use App\Type\ProjectInspiringType; | |||||
use App\Type\RevoltType; | |||||
use Doctrine\ORM\EntityManagerInterface; | use Doctrine\ORM\EntityManagerInterface; | ||||
use Doctrine\ORM\QueryBuilder; | use Doctrine\ORM\QueryBuilder; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Collection\FieldCollection; | use EasyCorp\Bundle\EasyAdminBundle\Collection\FieldCollection; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Config\Actions; | use EasyCorp\Bundle\EasyAdminBundle\Config\Actions; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto; | use EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Dto\SearchDto; | use EasyCorp\Bundle\EasyAdminBundle\Dto\SearchDto; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Field\HiddenField; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Field\IntegerField; | |||||
use Lc\SovBundle\Controller\AbstractAdminController as AbstractCrudController; | use Lc\SovBundle\Controller\AbstractAdminController as AbstractCrudController; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Field\EmailField; | use EasyCorp\Bundle\EasyAdminBundle\Field\EmailField; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | ||||
use Lc\SovBundle\Field\CollectionField; | |||||
use Lc\SovBundle\Field\StatusField; | use Lc\SovBundle\Field\StatusField; | ||||
class IndividualDataCrudController extends AbstractCrudController | class IndividualDataCrudController extends AbstractCrudController | ||||
public function configureFields(string $pageName): iterable | public function configureFields(string $pageName): iterable | ||||
{ | { | ||||
return [ | |||||
TextField::new('firstname'), | |||||
TextField::new('lastname'), | |||||
EmailField::new('email'), | |||||
TextField::new('introAnswer'), | |||||
StatusField::new('status')->setRequired(false) | |||||
]; | |||||
} | |||||
// TextField::new('firstname'), | |||||
// TextField::new('lastname'), | |||||
// EmailField::new('email'), | |||||
// TextField::new('introAnswer'), | |||||
$fields = array(); | |||||
public function persistEntity(EntityManagerInterface $entityManager, $entityInstance): void | |||||
{ | |||||
$configurationRepository = $this->getDoctrine()->getRepository(Configuration::class); | |||||
$fields[] = AssociationField::new('territory') | |||||
->setTemplatePath('crud/field/association.html.twig'); | |||||
$fields[] = TextField::new('nbDream') | |||||
->onlyOnIndex(); | |||||
$fields[] = TextField::new('nbRevolt') | |||||
->onlyOnIndex(); | |||||
$fields[] = TextField::new('nbProjectBoost') | |||||
->onlyOnIndex(); | |||||
$fields[] = TextField::new('nbProjectInspiring') | |||||
->onlyOnIndex(); | |||||
$fields[] = CollectionField::new('revolt') | |||||
->setFormTypeOption('entry_type', RevoltType::class) | |||||
->setFormTypeOption('by_reference', false) | |||||
->setRequired(false) | |||||
->hideOnIndex(); | |||||
$fields[] = CollectionField::new('dream') | |||||
->setFormTypeOption('entry_type', DreamType::class) | |||||
->setFormTypeOption('by_reference', false) | |||||
->setRequired(false) | |||||
->hideOnIndex(); | |||||
$fields[] = CollectionField::new('projectBoost') | |||||
->setFormTypeOption('entry_type', ProjectBoostType::class) | |||||
->setFormTypeOption('by_reference', false) | |||||
->setRequired(false) | |||||
->hideOnIndex(); | |||||
$fields[] = CollectionField::new('projectinspiring') | |||||
->setFormTypeOption('entry_type', ProjectInspiringType::class) | |||||
->setFormTypeOption('by_reference', false) | |||||
->setRequired(false) | |||||
->hideOnIndex(); | |||||
$hasAccess = $this->isGranted('ROLE_ADMIN'); | |||||
if ($hasAccess) { | |||||
$fields[] = StatusField::new('status') | |||||
->setFormTypeOption('data', 0) | |||||
->setFormTypeOption('choices', ['Validé' => 1, 'En attente' => 0]) | |||||
->setCustomOption('toggle_label', 'Valider') | |||||
->hideOnIndex(); | |||||
} else { | |||||
$fields[] = HiddenField::new('status') | |||||
->setFormTypeOption('data', 0) | |||||
->hideOnIndex(); | |||||
} | |||||
$configuration = $configurationRepository->findOneByDevAlias('intro_question'); | |||||
$entityInstance->setIntroQuestion($configuration->getValue()); | |||||
$entityManager->persist($entityInstance); | |||||
$entityManager->flush(); | |||||
parent::persistEntity($entityManager, $entityInstance); // TODO: Change the autogenerated stub | |||||
return $fields; | |||||
} | } | ||||
// public function persistEntity(EntityManagerInterface $entityManager, $entityInstance): void | |||||
// { | |||||
// $configurationRepository = $this->getDoctrine()->getRepository(Configuration::class); | |||||
// | |||||
// $configuration = $configurationRepository->findOneByDevAlias('intro_question'); | |||||
// $entityInstance->setIntroQuestion($configuration->getValue()); | |||||
// $entityManager->persist($entityInstance); | |||||
// $entityManager->flush(); | |||||
// | |||||
// parent::persistEntity($entityManager, $entityInstance); | |||||
// } | |||||
public function createIndexQueryBuilder( | public function createIndexQueryBuilder( | ||||
SearchDto $searchDto, | SearchDto $searchDto, | ||||
EntityDto $entityDto, | EntityDto $entityDto, |
<?php | |||||
namespace App\Controller\Admin; | |||||
use App\Entity\Subthematic; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | |||||
use Lc\SovBundle\Controller\AbstractAdminController as AbstractCrudController; | |||||
class SubthematicCrudController extends AbstractCrudController | |||||
{ | |||||
public static function getEntityFqcn(): string | |||||
{ | |||||
return Subthematic::class; | |||||
} | |||||
public function configureFields(string $pageName): iterable | |||||
{ | |||||
return [ | |||||
TextField::new('name'), | |||||
AssociationField::new('thematic') | |||||
->setTemplatePath('crud/field/association.html.twig') | |||||
]; | |||||
} | |||||
} |
namespace App\Controller\Admin; | namespace App\Controller\Admin; | ||||
use App\Entity\Thematic; | use App\Entity\Thematic; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Field\FormField; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | ||||
use Lc\SovBundle\Controller\AbstractAdminController as AbstractCrudController; | use Lc\SovBundle\Controller\AbstractAdminController as AbstractCrudController; | ||||
public function configureFields(string $pageName): iterable | public function configureFields(string $pageName): iterable | ||||
{ | { | ||||
return [ | return [ | ||||
TextField::new('name'), | |||||
TextField::new('name') | |||||
]; | ]; | ||||
} | } | ||||
private $id; | private $id; | ||||
/** | /** | ||||
* @ORM\Column(type="string", length=255) | |||||
* @ORM\Column(type="string", length=255, nullable=true) | |||||
*/ | */ | ||||
private $firstname; | private $firstname; | ||||
/** | /** | ||||
* @ORM\Column(type="string", length=255) | |||||
* @ORM\Column(type="string", length=255, nullable=true) | |||||
*/ | */ | ||||
private $lastname; | private $lastname; | ||||
/** | /** | ||||
* @ORM\Column(type="string", length=255) | |||||
* @ORM\Column(type="string", length=255, nullable=true) | |||||
*/ | */ | ||||
private $email; | private $email; | ||||
/** | /** | ||||
* @ORM\Column(type="string", length=255) | |||||
* @ORM\Column(type="string", length=255, nullable=true) | |||||
*/ | */ | ||||
private $introQuestion; | private $introQuestion; | ||||
private $introAnswer; | private $introAnswer; | ||||
/** | /** | ||||
* @ORM\OneToMany(targetEntity=Revolt::class, mappedBy="individualData") | |||||
* @ORM\OneToMany(targetEntity=Revolt::class, mappedBy="individualData", cascade={"persist", "remove"}) | |||||
*/ | */ | ||||
private $revolt; | private $revolt; | ||||
/** | /** | ||||
* @ORM\OneToMany(targetEntity=Dream::class, mappedBy="individualData") | |||||
* @ORM\OneToMany(targetEntity=Dream::class, mappedBy="individualData", cascade={"persist", "remove"}) | |||||
*/ | */ | ||||
private $dream; | private $dream; | ||||
/** | /** | ||||
* @ORM\OneToMany(targetEntity=ProjectBoost::class, mappedBy="individualData") | |||||
* @ORM\OneToMany(targetEntity=ProjectBoost::class, mappedBy="individualData", cascade={"persist", "remove"}) | |||||
*/ | */ | ||||
private $projectBoost; | private $projectBoost; | ||||
/** | /** | ||||
* @ORM\OneToMany(targetEntity=ProjectInspiring::class, mappedBy="individualData") | |||||
* @ORM\OneToMany(targetEntity=ProjectInspiring::class, mappedBy="individualData", cascade={"persist", "remove"}) | |||||
*/ | */ | ||||
private $projectInspiring; | private $projectInspiring; | ||||
return $this->firstname . " " . $this->lastname; | return $this->firstname . " " . $this->lastname; | ||||
} | } | ||||
public function getNbDream(): string | |||||
{ | |||||
return count($this->getDream()); | |||||
} | |||||
public function getNbRevolt(): string | |||||
{ | |||||
return count($this->getRevolt()); | |||||
} | |||||
public function getNbProjectBoost(): string | |||||
{ | |||||
return count($this->getProjectBoost()); | |||||
} | |||||
public function getNbProjectInspiring(): string | |||||
{ | |||||
return count($this->getProjectInspiring()); | |||||
} | |||||
public function getId(): ?int | public function getId(): ?int | ||||
{ | { | ||||
return $this->id; | return $this->id; |
<?php | |||||
namespace App\Entity; | |||||
use App\Repository\SubthematicRepository; | |||||
use Doctrine\ORM\Mapping as ORM; | |||||
use Lc\SovBundle\Doctrine\EntityInterface; | |||||
/** | |||||
* @ORM\Entity(repositoryClass=SubthematicRepository::class) | |||||
*/ | |||||
class Subthematic implements EntityInterface | |||||
{ | |||||
/** | |||||
* @ORM\Id | |||||
* @ORM\GeneratedValue | |||||
* @ORM\Column(type="integer") | |||||
*/ | |||||
private $id; | |||||
/** | |||||
* @ORM\Column(type="string", length=255) | |||||
*/ | |||||
private $name; | |||||
/** | |||||
* @ORM\ManyToOne(targetEntity=Thematic::class, inversedBy="subthematic") | |||||
*/ | |||||
private $thematic; | |||||
public function __toString() | |||||
{ | |||||
return $this->name; | |||||
} | |||||
public function getId(): ?int | |||||
{ | |||||
return $this->id; | |||||
} | |||||
public function getName(): ?string | |||||
{ | |||||
return $this->name; | |||||
} | |||||
public function setName(string $name): self | |||||
{ | |||||
$this->name = $name; | |||||
return $this; | |||||
} | |||||
public function getThematic(): ?Thematic | |||||
{ | |||||
return $this->thematic; | |||||
} | |||||
public function setThematic(?Thematic $thematic): self | |||||
{ | |||||
$this->thematic = $thematic; | |||||
return $this; | |||||
} | |||||
} |
namespace App\Entity; | namespace App\Entity; | ||||
use App\Repository\ThematicRepository; | use App\Repository\ThematicRepository; | ||||
use Doctrine\Common\Collections\ArrayCollection; | |||||
use Doctrine\Common\Collections\Collection; | |||||
use Doctrine\ORM\Mapping as ORM; | use Doctrine\ORM\Mapping as ORM; | ||||
use Lc\SovBundle\Doctrine\EntityInterface; | use Lc\SovBundle\Doctrine\EntityInterface; | ||||
*/ | */ | ||||
private $name; | private $name; | ||||
/** | |||||
* @ORM\OneToMany(targetEntity=Subthematic::class, mappedBy="thematic", cascade={"persist", "remove"}) | |||||
*/ | |||||
private $subthematic; | |||||
public function __construct() | |||||
{ | |||||
$this->subthematic = new ArrayCollection(); | |||||
} | |||||
public function __toString() | public function __toString() | ||||
{ | { | ||||
return $this->name; | return $this->name; | ||||
return $this; | return $this; | ||||
} | } | ||||
/** | |||||
* @return Collection|Subthematic[] | |||||
*/ | |||||
public function getSubthematic(): Collection | |||||
{ | |||||
return $this->subthematic; | |||||
} | |||||
public function addSubthematic(Subthematic $subthematic): self | |||||
{ | |||||
if (!$this->subthematic->contains($subthematic)) { | |||||
$this->subthematic[] = $subthematic; | |||||
$subthematic->setThematic($this); | |||||
} | |||||
return $this; | |||||
} | |||||
public function removeSubthematic(Subthematic $subthematic): self | |||||
{ | |||||
if ($this->subthematic->removeElement($subthematic)) { | |||||
// set the owning side to null (unless already changed) | |||||
if ($subthematic->getThematic() === $this) { | |||||
$subthematic->setThematic(null); | |||||
} | |||||
} | |||||
return $this; | |||||
} | |||||
} | } |
<?php | |||||
namespace App\Repository; | |||||
use App\Entity\Subthematic; | |||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; | |||||
use Doctrine\Persistence\ManagerRegistry; | |||||
/** | |||||
* @method Subthematic|null find($id, $lockMode = null, $lockVersion = null) | |||||
* @method Subthematic|null findOneBy(array $criteria, array $orderBy = null) | |||||
* @method Subthematic[] findAll() | |||||
* @method Subthematic[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) | |||||
*/ | |||||
class SubthematicRepository extends ServiceEntityRepository | |||||
{ | |||||
public function __construct(ManagerRegistry $registry) | |||||
{ | |||||
parent::__construct($registry, Subthematic::class); | |||||
} | |||||
// /** | |||||
// * @return Subthematic[] Returns an array of Subthematic 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): ?Subthematic | |||||
{ | |||||
return $this->createQueryBuilder('t') | |||||
->andWhere('t.exampleField = :val') | |||||
->setParameter('val', $value) | |||||
->getQuery() | |||||
->getOneOrNullResult() | |||||
; | |||||
} | |||||
*/ | |||||
} |
menu: | menu: | ||||
data_individual: Formulaire individuel | data_individual: Formulaire individuel | ||||
data_individual_new: Créer | |||||
data_individual_validate: Données validées | data_individual_validate: Données validées | ||||
data_individual_waiting: Données en attente | data_individual_waiting: Données en attente | ||||
data_collectif: Formulaire collectif | data_collectif: Formulaire collectif | ||||
data_collectif_create: Formulaire collectif | data_collectif_create: Formulaire collectif | ||||
territory: Territoires | territory: Territoires | ||||
thematic: Thématiques | thematic: Thématiques | ||||
subthematic: Sous-thémes | |||||
configuration: Configuration | configuration: Configuration | ||||
entity: | entity: | ||||
User: | User: | ||||
fields: | fields: | ||||
firstname: Prénom | firstname: Prénom | ||||
lastname: Nom | lastname: Nom | ||||
territory: Territoire | |||||
revolt: Les révoltes | |||||
dream: Les rêves | |||||
projectBoost: Les projets boostés | |||||
projectinspiring: Les projets inspirants | |||||
resume: Résumé | |||||
nbDream: Rêve(s) | |||||
nbRevolt: Révolte(s) | |||||
nbProjectBoost: Projet(s) boosté(s) | |||||
nbProjectInspiring: Projet(s) inspirant(s) | |||||
Thematic: | Thematic: | ||||
label_plurial: Les thémes | label_plurial: Les thémes | ||||
label: Thématique | label: Thématique | ||||
fields: | fields: | ||||
name: Nom | name: Nom | ||||
Subthematic: | |||||
label_plurial: Les sous-thémes | |||||
label: Sous-théme | |||||
fields: | |||||
name: Nom | |||||
thematic: Théme | |||||
Territory: | Territory: | ||||
label_plurial: Les territoires | label_plurial: Les territoires | ||||
label: Territoire | label: Territoire |