'workshop', | 'workshop', | ||||
'firstname', | 'firstname', | ||||
'lastname', | 'lastname', | ||||
'organization', | |||||
'city', | 'city', | ||||
'email', | 'email', | ||||
'phone', | 'phone', | ||||
->setFormTypeOption('choices', $workshopArray), | ->setFormTypeOption('choices', $workshopArray), | ||||
'firstname' => TextField::new('firstname'), | 'firstname' => TextField::new('firstname'), | ||||
'lastname' => TextField::new('lastname'), | 'lastname' => TextField::new('lastname'), | ||||
'organization' => TextField::new('organization'), | |||||
'city' => TextField::new('city'), | 'city' => TextField::new('city'), | ||||
'email' => EmailField::new('email'), | 'email' => EmailField::new('email'), | ||||
'phone' => TextField::new('phone'), | 'phone' => TextField::new('phone'), |
{ | { | ||||
return [ | return [ | ||||
'title', | 'title', | ||||
'image' | |||||
]; | |||||
} | |||||
public function configureForm(): array | |||||
{ | |||||
return [ | |||||
'image', | |||||
'title' | |||||
]; | ]; | ||||
} | } | ||||
public function configureFields(): array | public function configureFields(): array | ||||
{ | { | ||||
return [ | return [ | ||||
'title' => TextField::new('title'), | |||||
]; | ]; | ||||
} | } | ||||
} | } |
'workshopThematic', | 'workshopThematic', | ||||
'type', | 'type', | ||||
'title', | 'title', | ||||
'hook', | |||||
'description', | 'description', | ||||
//'entries' | //'entries' | ||||
]; | ]; | ||||
->setFormTypeOption('choices', $workshopThematicArray), | ->setFormTypeOption('choices', $workshopThematicArray), | ||||
'type' => AssociationField::new('type'), | 'type' => AssociationField::new('type'), | ||||
'title' => TextField::new('title'), | 'title' => TextField::new('title'), | ||||
'hook' => TextField::new('hook'), | |||||
'description' => TextareaField::new('description'), | 'description' => TextareaField::new('description'), | ||||
'entries' => AssociationField::new('entries') | 'entries' => AssociationField::new('entries') | ||||
->setTemplatePath('@LcPietro/admin/workshop/field/entries.html.twig') | ->setTemplatePath('@LcPietro/admin/workshop/field/entries.html.twig') |
return [ | return [ | ||||
'image', | 'image', | ||||
'title', | 'title', | ||||
'color' | |||||
]; | ]; | ||||
} | } | ||||
'image' => ImageManagerField::new('image'), | 'image' => ImageManagerField::new('image'), | ||||
'title' => TextField::new('title'), | 'title' => TextField::new('title'), | ||||
'description' => TextareaField::new('description'), | 'description' => TextareaField::new('description'), | ||||
'color' => TextField::new('color'), | |||||
]; | ]; | ||||
} | } | ||||
} | } |
*/ | */ | ||||
protected $firstname; | protected $firstname; | ||||
/** | |||||
* @ORM\Column(type="string", length=255, nullable=true) | |||||
*/ | |||||
protected $organization; | |||||
/** | /** | ||||
* @ORM\Column(type="string", length=20, nullable=true) | * @ORM\Column(type="string", length=20, nullable=true) | ||||
*/ | */ | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getOrganization(): ?string | |||||
{ | |||||
return $this->organization; | |||||
} | |||||
public function setOrganization(?string $organization): self | |||||
{ | |||||
$this->organization = $organization; | |||||
return $this; | |||||
} | |||||
public function getCity(): ?string | public function getCity(): ?string | ||||
{ | { | ||||
return $this->city; | return $this->city; |
use Doctrine\ORM\Mapping as ORM; | use Doctrine\ORM\Mapping as ORM; | ||||
use Lc\SovBundle\Doctrine\EntityInterface; | use Lc\SovBundle\Doctrine\EntityInterface; | ||||
use Lc\SovBundle\Doctrine\Extension\ImageTrait; | |||||
/** | /** | ||||
* @ORM\MappedSuperclass() | * @ORM\MappedSuperclass() | ||||
*/ | */ | ||||
abstract class Type implements TypeInterface, EntityInterface | abstract class Type implements TypeInterface, EntityInterface | ||||
{ | { | ||||
use ImageTrait; | |||||
/** | /** | ||||
* @ORM\Column(type="string", length=255) | * @ORM\Column(type="string", length=255) | ||||
*/ | */ |
*/ | */ | ||||
protected $entries; | protected $entries; | ||||
/** | |||||
* @ORM\Column(type="string", length=20, nullable=true) | |||||
*/ | |||||
protected $hook; | |||||
public function __construct() | public function __construct() | ||||
{ | { | ||||
$this->entries = new ArrayCollection(); | $this->entries = new ArrayCollection(); | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getHook(): ?string | |||||
{ | |||||
return $this->hook; | |||||
} | |||||
public function setHook(string $hook): self | |||||
{ | |||||
$this->hook = $hook; | |||||
return $this; | |||||
} | |||||
} | } |
use Doctrine\Common\Collections\Collection; | use Doctrine\Common\Collections\Collection; | ||||
use Doctrine\ORM\Mapping as ORM; | use Doctrine\ORM\Mapping as ORM; | ||||
use Lc\SovBundle\Doctrine\EntityInterface; | use Lc\SovBundle\Doctrine\EntityInterface; | ||||
use Lc\SovBundle\Doctrine\Extension\ImageTrait; | |||||
use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity; | use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity; | ||||
use Lc\SovBundle\Model\File\FileInterface; | use Lc\SovBundle\Model\File\FileInterface; | ||||
*/ | */ | ||||
abstract class WorkshopThematic extends AbstractFullEntity implements WorkshopThematicInterface, EntityInterface | abstract class WorkshopThematic extends AbstractFullEntity implements WorkshopThematicInterface, EntityInterface | ||||
{ | { | ||||
use ImageTrait; | |||||
/** | /** | ||||
* @ORM\OneToMany(targetEntity="Lc\PietroBundle\Model\Workshop\WorkshopInterface", mappedBy="thematic", cascade={"persist", "remove"}) | * @ORM\OneToMany(targetEntity="Lc\PietroBundle\Model\Workshop\WorkshopInterface", mappedBy="thematic", cascade={"persist", "remove"}) | ||||
*/ | */ | ||||
protected $workshops; | 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() | public function __construct() | ||||
{ | { | ||||
return $this; | 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; | return $this; | ||||
} | } |