/** * @param \Orm\Zed\Customer\Persistence\SpyCustomer|null $customer * * @return string */ protected function buildLinks(SpyCustomer $customer = null) { if ($customer === null) { return ''; } $buttons = []; $buttons[] = $this->generateViewButton('/customer/view?id-customer=' . $customer->getIdCustomer(), 'View'); $buttons[] = $this->generateEditButton('/customer/edit?id-customer=' . $customer->getIdCustomer(), 'Edit'); $buttons[] = $this->generateViewButton('/customer/address?id-customer=' . $customer->getIdCustomer(), 'Manage Addresses'); return implode(' ', $buttons); }
/** * @return array */ protected function getFormData() { $request = Request::create('/customer/edit?id-customer' . $this->customer->getIdCustomer(), 'GET', ['id-customer' => $this->customer->getIdCustomer()]); $application = (new Pimple())->getApplication(); $application['request'] = $request; $result = $this->controller->indexAction($request); return $this->getFormDataFromResult($result['form']); }
/** * @param \Orm\Zed\Customer\Persistence\SpyCustomer $customerEntity * * @return bool */ protected function isEmailAvailableForCustomer(SpyCustomer $customerEntity) { $count = $this->queryContainer->queryCustomerByEmailApartFromIdCustomer($customerEntity->getEmail(), $customerEntity->getIdCustomer())->count(); return $count === 0; }