Browse Source

Workshop : correctifs (champs hook + store)

develop
Guillaume 2 years ago
parent
commit
90443a6905
4 changed files with 22 additions and 5 deletions
  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 View File

'workshopThematic', 'workshopThematic',
'title', 'title',
'entries', 'entries',
'status'
]; ];
} }


return [ return [
'workshopThematic', 'workshopThematic',
'type', 'type',
'title',
'hook', 'hook',
'title',
'description', 'description',
//'entries'
'status'
]; ];
} }


'type' => AssociationField::new('type'), 'type' => AssociationField::new('type'),
'title' => TextField::new('title'), 'title' => TextField::new('title'),
'hook' => TextField::new('hook'), 'hook' => TextField::new('hook'),
'description' => TextareaField::new('description'),
'description' => CKEditorField::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')
]; ];

+ 1
- 1
Model/Workshop/Workshop.php View File

protected $entries; protected $entries;


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



+ 6
- 0
Repository/Workshop/WorkshopRepositoryQuery.php View File

namespace Lc\PietroBundle\Repository\Workshop; namespace Lc\PietroBundle\Repository\Workshop;


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


class WorkshopRepositoryQuery extends AbstractRepositoryQuery class WorkshopRepositoryQuery extends AbstractRepositoryQuery
{ {
parent::__construct($repository, 'workshop', $paginator); parent::__construct($repository, 'workshop', $paginator);
} }

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

+ 11
- 1
Repository/Workshop/WorkshopStore.php View File



namespace Lc\PietroBundle\Repository\Workshop; namespace Lc\PietroBundle\Repository\Workshop;


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




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


{ {
return $query; return $query;
} }

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

Loading…
Cancel
Save