/**
  * action editMenus
  *
  * @param array $customerTypenames
  * @param array $submit
  * @return void
  */
 public function updateMenusAction($customerTypenames, $submit)
 {
     foreach ($submit as $submCustomerUid => $val) {
         foreach ($customerTypenames as $customerUid => $customerTypenames) {
             if ($submCustomerUid == $customerUid) {
                 foreach ($customerTypenames as $typeUid => $typename) {
                     $customerTypename = $this->customerTypenameRepository->findOneByCustomerAndType($customerUid, $typeUid);
                     if ($customerTypename != NULL) {
                         $customerTypename->setName($typename);
                         $this->customerTypenameRepository->update($customerTypename);
                     } else {
                         $customerTypename = new \GK\Stdapp\Domain\Model\CustomerTypename();
                         $customer = $this->customerRepository->findByUid($customerUid);
                         if ($customer == NULL) {
                             die("Customer not found!");
                         }
                         $resourceType = $this->resourceTypeRepository->findByUid($typeUid);
                         if ($resourceType == NULL) {
                             die("ResourceType not found!");
                         }
                         $customerTypename->setName($typename);
                         $customerTypename->setType($resourceType);
                         $customer->addTypename($customerTypename);
                         $this->customerRepository->update($customer);
                     }
                 }
             }
         }
     }
     $this->flashMessageContainer->add('Menu Names updated.');
     $this->redirect('editMenus');
 }
 /**
  * action delete
  *
  * @param \GK\Stdapp\Domain\Model\Message $message
  * @return void
  */
 public function deleteAction(\GK\Stdapp\Domain\Model\Message $message)
 {
     $customer = $this->portalUser->getCustomer()->_loadRealInstance();
     $customer->removeMessage($message);
     $this->customerRepository->update($customer);
     $this->flashMessageContainer->add('Your Message was deleted.');
     $this->redirect('edit');
 }
Exemple #3
0
 /**
  * action subscribe
  *
  * @param string $identifier
  * @param string $token
  * @param \GK\Stdapp\Domain\Model\Language $language
  * @return string
  */
 public function subscribeAction($identifier, $token, $language = NULL)
 {
     $customer = $this->customerRepository->findOneByIdentifier($identifier);
     if ($customer == NULL) {
         die("Customer not eligible");
     }
     $this->updateSubscriber($customer, $token, $language);
     return json_encode(array());
 }
 /**
  * action delete
  *
  * @param \GK\Stdapp\Domain\Model\Customer $customer
  * @return void
  */
 public function deleteAction(\GK\Stdapp\Domain\Model\Customer $customer)
 {
     $this->customerRepository->remove($customer);
     $this->flashMessageContainer->add('Your Customer was removed.');
     $this->redirect('list');
 }