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