/** * Get the first wishlist for the customer, if any. * * @param CustomerInterface $customer * @return WishlistInterface|null */ public function getFirstForCustomer(CustomerInterface $customer) { // Get query builder $queryBuilder = $this->createQueryBuilder('o'); // Apply customer condition $queryBuilder->where('IDENTITY(o.customer) = :customerId'); $queryBuilder->setParameter('customerId', $customer->getId()); $queryBuilder->orderBy('o.createdAt', 'asc'); $queryBuilder->setMaxResults(1); // Get the result return $queryBuilder->getQuery()->getOneOrNullResult(); }
/** * @Given I want to enable :customer * @Given I want to disable :customer */ public function iWantToChangeStatusOf(CustomerInterface $customer) { $this->updatePage->open(['id' => $customer->getId()]); }
/** * @When I view details of the customer :customer */ public function iViewDetailsOfTheCustomer(CustomerInterface $customer) { $this->showPage->open(['id' => $customer->getId()]); }