Browse Source

workshop : ajout champs "emailContact" et "website"

develop
Guillaume Bourgeois 2 years ago
parent
commit
9b8da8915f
3 changed files with 50 additions and 0 deletions
  1. +4
    -0
      Definition/Field/Workshop/WorkshopFieldDefinition.php
  2. +34
    -0
      Model/Workshop/Workshop.php
  3. +12
    -0
      Resources/translations/admin.fr.yaml

+ 4
- 0
Definition/Field/Workshop/WorkshopFieldDefinition.php View File

@@ -39,6 +39,8 @@ class WorkshopFieldDefinition extends AbstractFieldDefinition
'hook',
'title',
'description',
'emailContact',
'website',
'status'
];
}
@@ -54,6 +56,8 @@ class WorkshopFieldDefinition extends AbstractFieldDefinition
'title' => TextField::new('title'),
'hook' => TextField::new('hook'),
'description' => CKEditorField::new('description'),
'emailContact' => TextField::new('emailContact'),
'website' => TextField::new('website'),
'entries' => AssociationField::new('entries')
->setTemplatePath('@LcPietro/admin/workshop/field/entries.html.twig')
];

+ 34
- 0
Model/Workshop/Workshop.php View File

@@ -43,6 +43,16 @@ abstract class Workshop extends AbstractFullEntity implements WorkshopInterface,
*/
protected $videoLink;

/**
* @ORM\Column(type="string", length=180, nullable=true)
*/
protected $emailContact;

/**
* @ORM\Column(type="string", length=256, nullable=true)
*/
protected $website;

public function __construct()
{
$this->entries = new ArrayCollection();
@@ -152,4 +162,28 @@ abstract class Workshop extends AbstractFullEntity implements WorkshopInterface,

return $this;
}

public function getEmailContact(): ?string
{
return $this->emailContact;
}

public function setEmailContact(string $emailContact): self
{
$this->emailContact = $emailContact;

return $this;
}

public function getWebsite(): ?string
{
return $this->website;
}

public function setWebsite(string $website): self
{
$this->website = $website;

return $this;
}
}

+ 12
- 0
Resources/translations/admin.fr.yaml View File

@@ -40,6 +40,18 @@ entity:
label: Territoire
fields:
name: Nom
Workshop:
label: Atelier
label_plurial: Ateliers
fields:
workshopThematic: Thématique
entries: Inscriptions
type: Type
hook: Accroche
videoLink: Lien vidéo
emailContact: Email de contact
website: Site internet

form:
field:
dream:

Loading…
Cancel
Save