瀏覽代碼

Merge branch 'develop'

master
Guillaume 2 年之前
父節點
當前提交
363b49aa3a
共有 4 個檔案被更改,包括 22 行新增5 行删除
  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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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 查看文件

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

Loading…
取消
儲存