add price

This commit is contained in:
Simon Vieille 2022-05-31 19:44:43 +02:00
parent e2b627a1d5
commit 1a212359a1
Signed by: deblan
GPG key ID: 579388D585F70417
2 changed files with 26 additions and 0 deletions

View file

@ -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;
}
}

View file

@ -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],
])