Преглед на файлове

Merge branch 'develop'

develop
Fabien Normand преди 2 години
родител
ревизия
c7f8b978e2
променени са 2 файла, в които са добавени 30 реда и са изтрити 0 реда
  1. +4
    -0
      Definition/Field/AbstractFieldDefinition.php
  2. +26
    -0
      Doctrine/Extension/ImageTrait.php

+ 4
- 0
Definition/Field/AbstractFieldDefinition.php Целия файл

@@ -8,6 +8,7 @@ use EasyCorp\Bundle\EasyAdminBundle\Field\FormField;
use EasyCorp\Bundle\EasyAdminBundle\Field\IntegerField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextareaField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
use Lc\SovBundle\Field\CKEditorField;
use Lc\SovBundle\Field\CollectionField;
use Lc\SovBundle\Field\ImageManagerField;
use Lc\SovBundle\Field\StatusField;
@@ -29,6 +30,9 @@ abstract class AbstractFieldDefinition
{
return [
'id' => IntegerField::new('id')->onlyOnIndex()->setSortable(true),
'title' => TextField::new('title'),
'description' => CKEditorField::new('description'),
'image' => ImageManagerField::new('image'),
'metaTitle' => TextField::new('metaTitle')
->setLabel('Meta : title')
->setHelp('Affiché dans les résultats de recherche Google'),

+ 26
- 0
Doctrine/Extension/ImageTrait.php Целия файл

@@ -0,0 +1,26 @@
<?php

namespace Lc\SovBundle\Doctrine\Extension;

use App\Entity\File\File;
use Doctrine\ORM\Mapping as ORM;

trait ImageTrait
{
/**
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\File\FileInterface", cascade={"persist", "remove"}, fetch="EAGER")
*/
protected $image;

public function getImage(): ?File
{
return $this->image;
}

public function setImage(?File $image): self
{
$this->image = $image;

return $this;
}
}

Loading…
Отказ
Запис