浏览代码

Merge branch 'develop'

master
Guillaume 2 年前
父节点
当前提交
09d843ce53
共有 8 个文件被更改,包括 61 次插入7 次删除
  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 查看文件

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

+ 9
- 1
Definition/Field/Workshop/TypeFieldDefinition.php 查看文件

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

+ 2
- 0
Definition/Field/Workshop/WorkshopFieldDefinition.php 查看文件

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

+ 2
- 0
Definition/Field/Workshop/WorkshopThematicFieldDefinition.php 查看文件

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

+ 17
- 0
Model/Workshop/Entry.php 查看文件

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

+ 3
- 0
Model/Workshop/Type.php 查看文件

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

+ 17
- 0
Model/Workshop/Workshop.php 查看文件

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

+ 9
- 6
Model/Workshop/WorkshopThematic.php 查看文件

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

正在加载...
取消
保存