@@ -27,6 +27,7 @@ class EntryFieldDefinition extends AbstractFieldDefinition | |||
'workshop', | |||
'firstname', | |||
'lastname', | |||
'organization', | |||
'city', | |||
'email', | |||
'phone', | |||
@@ -43,6 +44,7 @@ class EntryFieldDefinition extends AbstractFieldDefinition | |||
->setFormTypeOption('choices', $workshopArray), | |||
'firstname' => TextField::new('firstname'), | |||
'lastname' => TextField::new('lastname'), | |||
'organization' => TextField::new('organization'), | |||
'city' => TextField::new('city'), | |||
'email' => EmailField::new('email'), | |||
'phone' => TextField::new('phone'), |
@@ -16,13 +16,21 @@ class TypeFieldDefinition extends AbstractFieldDefinition | |||
{ | |||
return [ | |||
'title', | |||
'image' | |||
]; | |||
} | |||
public function configureForm(): array | |||
{ | |||
return [ | |||
'image', | |||
'title' | |||
]; | |||
} | |||
public function configureFields(): array | |||
{ | |||
return [ | |||
'title' => TextField::new('title'), | |||
]; | |||
} | |||
} |
@@ -37,6 +37,7 @@ class WorkshopFieldDefinition extends AbstractFieldDefinition | |||
'workshopThematic', | |||
'type', | |||
'title', | |||
'hook', | |||
'description', | |||
//'entries' | |||
]; | |||
@@ -51,6 +52,7 @@ class WorkshopFieldDefinition extends AbstractFieldDefinition | |||
->setFormTypeOption('choices', $workshopThematicArray), | |||
'type' => AssociationField::new('type'), | |||
'title' => TextField::new('title'), | |||
'hook' => TextField::new('hook'), | |||
'description' => TextareaField::new('description'), | |||
'entries' => AssociationField::new('entries') | |||
->setTemplatePath('@LcPietro/admin/workshop/field/entries.html.twig') |
@@ -16,6 +16,7 @@ class WorkshopThematicFieldDefinition extends AbstractFieldDefinition | |||
return [ | |||
'image', | |||
'title', | |||
'color' | |||
]; | |||
} | |||
@@ -25,6 +26,7 @@ class WorkshopThematicFieldDefinition extends AbstractFieldDefinition | |||
'image' => ImageManagerField::new('image'), | |||
'title' => TextField::new('title'), | |||
'description' => TextareaField::new('description'), | |||
'color' => TextField::new('color'), | |||
]; | |||
} | |||
} |
@@ -25,6 +25,11 @@ abstract class Entry implements EntryInterface, EntityInterface | |||
*/ | |||
protected $firstname; | |||
/** | |||
* @ORM\Column(type="string", length=255, nullable=true) | |||
*/ | |||
protected $organization; | |||
/** | |||
* @ORM\Column(type="string", length=20, nullable=true) | |||
*/ | |||
@@ -86,6 +91,18 @@ abstract class Entry implements EntryInterface, EntityInterface | |||
return $this; | |||
} | |||
public function getOrganization(): ?string | |||
{ | |||
return $this->organization; | |||
} | |||
public function setOrganization(?string $organization): self | |||
{ | |||
$this->organization = $organization; | |||
return $this; | |||
} | |||
public function getCity(): ?string | |||
{ | |||
return $this->city; |
@@ -4,12 +4,15 @@ namespace Lc\PietroBundle\Model\Workshop; | |||
use Doctrine\ORM\Mapping as ORM; | |||
use Lc\SovBundle\Doctrine\EntityInterface; | |||
use Lc\SovBundle\Doctrine\Extension\ImageTrait; | |||
/** | |||
* @ORM\MappedSuperclass() | |||
*/ | |||
abstract class Type implements TypeInterface, EntityInterface | |||
{ | |||
use ImageTrait; | |||
/** | |||
* @ORM\Column(type="string", length=255) | |||
*/ |
@@ -28,6 +28,11 @@ abstract class Workshop extends AbstractFullEntity implements WorkshopInterface, | |||
*/ | |||
protected $entries; | |||
/** | |||
* @ORM\Column(type="string", length=20, nullable=true) | |||
*/ | |||
protected $hook; | |||
public function __construct() | |||
{ | |||
$this->entries = new ArrayCollection(); | |||
@@ -87,4 +92,16 @@ abstract class Workshop extends AbstractFullEntity implements WorkshopInterface, | |||
return $this; | |||
} | |||
public function getHook(): ?string | |||
{ | |||
return $this->hook; | |||
} | |||
public function setHook(string $hook): self | |||
{ | |||
$this->hook = $hook; | |||
return $this; | |||
} | |||
} |
@@ -6,6 +6,7 @@ use Doctrine\Common\Collections\ArrayCollection; | |||
use Doctrine\Common\Collections\Collection; | |||
use Doctrine\ORM\Mapping as ORM; | |||
use Lc\SovBundle\Doctrine\EntityInterface; | |||
use Lc\SovBundle\Doctrine\Extension\ImageTrait; | |||
use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity; | |||
use Lc\SovBundle\Model\File\FileInterface; | |||
@@ -14,15 +15,17 @@ use Lc\SovBundle\Model\File\FileInterface; | |||
*/ | |||
abstract class WorkshopThematic extends AbstractFullEntity implements WorkshopThematicInterface, EntityInterface | |||
{ | |||
use ImageTrait; | |||
/** | |||
* @ORM\OneToMany(targetEntity="Lc\PietroBundle\Model\Workshop\WorkshopInterface", mappedBy="thematic", cascade={"persist", "remove"}) | |||
*/ | |||
protected $workshops; | |||
/** | |||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\File\FileInterface", cascade={"persist", "remove"}) | |||
* @ORM\Column(type="string", length=255, nullable=true) | |||
*/ | |||
protected $image; | |||
protected $color; | |||
public function __construct() | |||
{ | |||
@@ -60,14 +63,14 @@ abstract class WorkshopThematic extends AbstractFullEntity implements WorkshopTh | |||
return $this; | |||
} | |||
public function getImage(): ?FileInterface | |||
public function getColor(): ?string | |||
{ | |||
return $this->image; | |||
return $this->color; | |||
} | |||
public function setImage(?FileInterface $image): self | |||
public function setColor(?string $color): self | |||
{ | |||
$this->image = $image; | |||
$this->color = $color; | |||
return $this; | |||
} |