Browse Source

Merge branch 'develop'

master
Guillaume 2 years ago
parent
commit
09d843ce53
8 changed files with 61 additions and 7 deletions
  1. +2
    -0
      Definition/Field/Workshop/EntryFieldDefinition.php
  2. +9
    -1
      Definition/Field/Workshop/TypeFieldDefinition.php
  3. +2
    -0
      Definition/Field/Workshop/WorkshopFieldDefinition.php
  4. +2
    -0
      Definition/Field/Workshop/WorkshopThematicFieldDefinition.php
  5. +17
    -0
      Model/Workshop/Entry.php
  6. +3
    -0
      Model/Workshop/Type.php
  7. +17
    -0
      Model/Workshop/Workshop.php
  8. +9
    -6
      Model/Workshop/WorkshopThematic.php

+ 2
- 0
Definition/Field/Workshop/EntryFieldDefinition.php View File

'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'),

+ 9
- 1
Definition/Field/Workshop/TypeFieldDefinition.php View File

{ {
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'),
]; ];
} }
} }

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

'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')

+ 2
- 0
Definition/Field/Workshop/WorkshopThematicFieldDefinition.php View File

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'),
]; ];
} }
} }

+ 17
- 0
Model/Workshop/Entry.php View File

*/ */
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;

+ 3
- 0
Model/Workshop/Type.php View File



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)
*/ */

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

*/ */
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;
}
} }

+ 9
- 6
Model/Workshop/WorkshopThematic.php View File

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

Loading…
Cancel
Save