diff --git a/src/Entity/Intervention.php b/src/Entity/Intervention.php index 3ddc9f8..4a18dca 100644 --- a/src/Entity/Intervention.php +++ b/src/Entity/Intervention.php @@ -91,6 +91,11 @@ class Intervention implements EntityInterface */ protected $establishmentGroups; + /** + * @ORM\Column(type="float", nullable=true) + */ + private $price; + public function __construct() { $this->speakers = new ArrayCollection(); @@ -325,4 +330,16 @@ class Intervention implements EntityInterface return $this; } + + public function getPrice(): ?float + { + return $this->price; + } + + public function setPrice(?float $price): self + { + $this->price = $price; + + return $this; + } } diff --git a/src/Form/InterventionType.php b/src/Form/InterventionType.php index 63af00f..bb8100a 100644 --- a/src/Form/InterventionType.php +++ b/src/Form/InterventionType.php @@ -9,6 +9,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use App\Entity\Establishment; use Doctrine\ORM\EntityRepository; +use Symfony\Component\Form\Extension\Core\Type\NumberType; class InterventionType extends AbstractType { @@ -32,6 +33,14 @@ class InterventionType extends AbstractType ->add('tools', null, [ 'expanded' => true, ]) + ->add('price', NumberType::class, [ + 'attr' => [ + 'step' => 0.01, + ], + 'scale' => 2, + 'required' => false, + 'html5' => true, + ]) ->add('toolsDetails', null, [ 'attr' => ['rows' => 5], ])