| @@ 18-29 (lines=12) @@ | ||
| 15 | * @param int $scopable |
|
| 16 | * @return \Doctrine\ORM\QueryBuilder |
|
| 17 | */ |
|
| 18 | public function findByScopable($scopable = 1) |
|
| 19 | { |
|
| 20 | $result = $this->getEntityManager() |
|
| 21 | ->createQueryBuilder() |
|
| 22 | ->select('attr') |
|
| 23 | ->from('PimCatalogBundle:Attribute', 'attr') |
|
| 24 | ->where('attr.scopable = :scopable') |
|
| 25 | ->setParameter(':scopable', $scopable) |
|
| 26 | ->orderBy('attr.id', 'desc'); |
|
| 27 | ||
| 28 | return $result; |
|
| 29 | } |
|
| 30 | ||
| 31 | /** |
|
| 32 | * Find attributes by `localizable` attribute. By default fetches localizable attributes |
|
| @@ 37-48 (lines=12) @@ | ||
| 34 | * @param int $localizable |
|
| 35 | * @return \Doctrine\ORM\QueryBuilder |
|
| 36 | */ |
|
| 37 | public function findByLocalizable($localizable = 1) |
|
| 38 | { |
|
| 39 | $result = $this->getEntityManager() |
|
| 40 | ->createQueryBuilder() |
|
| 41 | ->select('attr') |
|
| 42 | ->from('PimCatalogBundle:Attribute', 'attr') |
|
| 43 | ->where('attr.localizable = :localizable') |
|
| 44 | ->setParameter(':localizable', $localizable) |
|
| 45 | ->orderBy('attr.id', 'desc'); |
|
| 46 | ||
| 47 | return $result; |
|
| 48 | } |
|
| 49 | ||
| 50 | /** |
|
| 51 | * Find attributes by attributeType. |
|