This repository has been archived by the owner on Aug 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Theodac
committed
Mar 27, 2018
1 parent
34bd3b3
commit 7dd341b
Showing
6 changed files
with
185 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?php | ||
|
||
namespace App\Entity; | ||
|
||
use Doctrine\ORM\Mapping as ORM; | ||
|
||
/** | ||
* @ORM\Entity(repositoryClass="App\Repository\ResumeRepository") | ||
*/ | ||
class Resume | ||
{ | ||
/** | ||
* @ORM\Id() | ||
* @ORM\GeneratedValue() | ||
* @ORM\Column(type="integer") | ||
*/ | ||
private $id; | ||
|
||
/** | ||
* @ORM\Column(type="string") | ||
*/ | ||
private $titre; | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getTitre() | ||
{ | ||
return $this->titre; | ||
} | ||
|
||
/** | ||
* @param mixed $titre | ||
*/ | ||
public function setTitre($titre): void | ||
{ | ||
$this->titre = $titre; | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getContenu() | ||
{ | ||
return $this->contenu; | ||
} | ||
|
||
/** | ||
* @param mixed $contenu | ||
*/ | ||
public function setContenu($contenu): void | ||
{ | ||
$this->contenu = $contenu; | ||
} | ||
|
||
/** | ||
* @ORM\Column(type="string") | ||
*/ | ||
private $contenu; | ||
|
||
/** | ||
* @ORM\OneToOne(targetEntity="App\Entity\Parties") | ||
*/ | ||
private $partie; | ||
|
||
public function getId() | ||
{ | ||
return $this->id; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: WEBENOO | ||
* Date: 26/03/2018 | ||
* Time: 20:39 | ||
*/ | ||
|
||
namespace App\Form; | ||
|
||
|
||
use Symfony\Component\Form\AbstractType; | ||
use Symfony\Component\Form\Extension\Core\Type\SubmitType; | ||
use Symfony\Component\Form\Extension\Core\Type\TextareaType; | ||
use Symfony\Component\Form\Extension\Core\Type\TextType; | ||
use Symfony\Component\Form\FormBuilderInterface; | ||
|
||
class ResumeType extends AbstractType | ||
{ | ||
public function buildForm(FormBuilderInterface $builder, array $options) | ||
{ | ||
$builder | ||
->add('titre',TextType::class , [ | ||
'required' => true, | ||
'label' => 'Titre du résumé', | ||
'attr' => [ | ||
'class' => 'titre' | ||
] | ||
]) | ||
->add('contenu',TextareaType::class,[ | ||
'required' => true, | ||
'label' => 'Contenu de votre resumé', | ||
'attr' =>[ | ||
'class' => 'contenu' | ||
] | ||
]) | ||
->add('envoi' ,SubmitType::class,[ | ||
'attr' => [ | ||
'class' => 'send' | ||
] | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
namespace App\Repository; | ||
|
||
use App\Entity\Resume; | ||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; | ||
use Symfony\Bridge\Doctrine\RegistryInterface; | ||
|
||
/** | ||
* @method Resume|null find($id, $lockMode = null, $lockVersion = null) | ||
* @method Resume|null findOneBy(array $criteria, array $orderBy = null) | ||
* @method Resume[] findAll() | ||
* @method Resume[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) | ||
*/ | ||
class ResumeRepository extends ServiceEntityRepository | ||
{ | ||
public function __construct(RegistryInterface $registry) | ||
{ | ||
parent::__construct($registry, Resume::class); | ||
} | ||
|
||
// /** | ||
// * @return Resume[] Returns an array of Resume objects | ||
// */ | ||
/* | ||
public function findByExampleField($value) | ||
{ | ||
return $this->createQueryBuilder('r') | ||
->andWhere('r.exampleField = :val') | ||
->setParameter('val', $value) | ||
->orderBy('r.id', 'ASC') | ||
->setMaxResults(10) | ||
->getQuery() | ||
->getResult() | ||
; | ||
} | ||
*/ | ||
|
||
/* | ||
public function findOneBySomeField($value): ?Resume | ||
{ | ||
return $this->createQueryBuilder('r') | ||
->andWhere('r.exampleField = :val') | ||
->setParameter('val', $value) | ||
->getQuery() | ||
->getOneOrNullResult() | ||
; | ||
} | ||
*/ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters