Quellcode durchsuchen

Workshop : correctifs (champs hook + store)

develop
Guillaume vor 2 Jahren
Ursprung
Commit
90443a6905
4 geänderte Dateien mit 22 neuen und 5 gelöschten Zeilen
  1. +4
    -3
      Definition/Field/Workshop/WorkshopFieldDefinition.php
  2. +1
    -1
      Model/Workshop/Workshop.php
  3. +6
    -0
      Repository/Workshop/WorkshopRepositoryQuery.php
  4. +11
    -1
      Repository/Workshop/WorkshopStore.php

+ 4
- 3
Definition/Field/Workshop/WorkshopFieldDefinition.php Datei anzeigen

@@ -28,6 +28,7 @@ class WorkshopFieldDefinition extends AbstractFieldDefinition
'workshopThematic',
'title',
'entries',
'status'
];
}

@@ -36,10 +37,10 @@ class WorkshopFieldDefinition extends AbstractFieldDefinition
return [
'workshopThematic',
'type',
'title',
'hook',
'title',
'description',
//'entries'
'status'
];
}

@@ -53,7 +54,7 @@ class WorkshopFieldDefinition extends AbstractFieldDefinition
'type' => AssociationField::new('type'),
'title' => TextField::new('title'),
'hook' => TextField::new('hook'),
'description' => TextareaField::new('description'),
'description' => CKEditorField::new('description'),
'entries' => AssociationField::new('entries')
->setTemplatePath('@LcPietro/admin/workshop/field/entries.html.twig')
];

+ 1
- 1
Model/Workshop/Workshop.php Datei anzeigen

@@ -29,7 +29,7 @@ abstract class Workshop extends AbstractFullEntity implements WorkshopInterface,
protected $entries;

/**
* @ORM\Column(type="string", length=20, nullable=true)
* @ORM\Column(type="string", length=256, nullable=true)
*/
protected $hook;


+ 6
- 0
Repository/Workshop/WorkshopRepositoryQuery.php Datei anzeigen

@@ -3,6 +3,7 @@
namespace Lc\PietroBundle\Repository\Workshop;

use Knp\Component\Pager\PaginatorInterface;
use Lc\PietroBundle\Model\Workshop\WorkshopThematicInterface;
use Lc\SovBundle\Repository\AbstractRepositoryQuery;

class WorkshopRepositoryQuery extends AbstractRepositoryQuery
@@ -11,4 +12,9 @@ class WorkshopRepositoryQuery extends AbstractRepositoryQuery
{
parent::__construct($repository, 'workshop', $paginator);
}

public function filterByWorkshopThematic(WorkshopThematicInterface $workshopThematic)
{
return $this->andWhereEqual('workshopThematic', $workshopThematic);
}
}

+ 11
- 1
Repository/Workshop/WorkshopStore.php Datei anzeigen

@@ -2,6 +2,7 @@

namespace Lc\PietroBundle\Repository\Workshop;

use Lc\PietroBundle\Model\Workshop\WorkshopThematicInterface;
use Lc\SovBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

@@ -16,7 +17,7 @@ class WorkshopStore extends AbstractStore

public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
{
$query->orderBy('id');
$query->orderBy('position');
return $query;
}

@@ -29,4 +30,13 @@ class WorkshopStore extends AbstractStore
{
return $query;
}

public function findOnlineByWorkshopThematic(WorkshopThematicInterface $workshopThematic, $query = null)
{
$query = $this->createDefaultQuery($query);
$query
->filterByWorkshopThematic($workshopThematic)
->filterIsOnline();
return $query->find();
}
}

Laden…
Abbrechen
Speichern