andWhereEqual('type', $type); } public function filterByBuyerAddress(AddressInterface $buyerAddress) { return $this ->andWhere('.buyerAddress = :buyerAddress') ->setParameter('buyerAddress', $buyerAddress); } public function filterByReference(string $reference = null) { if(is_null($reference)) { return $this->andWhere('.reference IS NULL'); } else { return $this ->andWhere('.reference LIKE :reference') ->setParameter('reference', $reference); } } public function filterIsReferenceNotNull() { return $this->andWhere('.reference IS NOT NULL'); } }