| @@ 62-72 (lines=11) @@ | ||
| 59 | * |
|
| 60 | * @return array Query result |
|
| 61 | */ |
|
| 62 | public function getArticleFromSupplier($supplier) |
|
| 63 | { |
|
| 64 | $query = $this->createQueryBuilder('a') |
|
| 65 | ->where('a.active = true') |
|
| 66 | ->andWhere('a.supplier = :id') |
|
| 67 | ->setParameter('id', $supplier) |
|
| 68 | ->orderBy('a.name', 'ASC') |
|
| 69 | ->getQuery(); |
|
| 70 | ||
| 71 | return $query->getResult(); |
|
| 72 | } |
|
| 73 | ||
| 74 | public function getStockAlert($count) { |
|
| 75 | $query = $this->createQueryBuilder('a') |
|
| @@ 74-83 (lines=10) @@ | ||
| 71 | return $query->getResult(); |
|
| 72 | } |
|
| 73 | ||
| 74 | public function getStockAlert($count) { |
|
| 75 | $query = $this->createQueryBuilder('a') |
|
| 76 | ->where('a.active = true') |
|
| 77 | ->andWhere('a.quantity < a.minstock') |
|
| 78 | ->orderBy('a.name', 'ASC') |
|
| 79 | ->setMaxResults($count) |
|
| 80 | ->getQuery(); |
|
| 81 | ||
| 82 | return $query->getResult(); |
|
| 83 | } |
|
| 84 | } |
|
| 85 | ||