File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Bundle/BusinessPageBundle/Repository Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 12
12
class BusinessPageRepository extends EntityRepository
13
13
{
14
14
/**
15
- * Find the pagePatterns of the business entity.
15
+ * Find the pagePatterns of the business entity.
16
16
*
17
- * @param BusinessEntity $businessEntity
17
+ * @param BusinessTemplate $pattern
18
+ * @param object $entity | int $entityId
19
+ * @param BusinessEntity $businessEntity
18
20
*
19
- * @return array The list of pagePatterns
21
+ * @return mixed
20
22
*/
21
23
public function findPageByBusinessEntityAndPattern (BusinessTemplate $ pattern , $ entity , BusinessEntity $ businessEntity )
22
24
{
25
+ if (is_object ($ entity )) {
26
+ $ entity = $ entity ->getId ();
27
+ }
23
28
$ qb = $ this ->createQueryBuilder ('BusinessPage ' );
24
29
$ qb ->join ('BusinessPage.entityProxy ' , 'proxy ' );
25
30
$ qb ->join ('BusinessPage.template ' , 'template ' );
@@ -30,7 +35,7 @@ public function findPageByBusinessEntityAndPattern(BusinessTemplate $pattern, $e
30
35
$ qb ->andWhere ('entity.id = :entityId ' );
31
36
32
37
$ qb ->setParameter (':templateId ' , $ pattern );
33
- $ qb ->setParameter (':entityId ' , $ entity-> getId () );
38
+ $ qb ->setParameter (':entityId ' , $ entity );
34
39
$ result = $ qb ->getQuery ()->getOneOrNullResult ();
35
40
36
41
return $ result ;
You can’t perform that action at this time.
0 commit comments