Exemple #1
0
 /**
  * Gets the Imprint.
  *
  * @param array $where
  * @return ImprintModel[]|array
  */
 public function getImprint($where = array())
 {
     $entryArray = $this->db()->select('*')->from('imprint')->where($where)->order(array('id' => 'DESC'))->execute()->fetchRows();
     if (empty($entryArray)) {
         return array();
     }
     $imprint = array();
     foreach ($entryArray as $entries) {
         $entryModel = new ImprintModel();
         $entryModel->setId($entries['id']);
         $entryModel->setParagraph($entries['paragraph']);
         $entryModel->setCompany($entries['company']);
         $entryModel->setName($entries['name']);
         $entryModel->setAddress($entries['address']);
         $entryModel->setAddressAdd($entries['addressadd']);
         $entryModel->setCity($entries['city']);
         $entryModel->setPhone($entries['phone']);
         $entryModel->setFax($entries['fax']);
         $entryModel->setEmail($entries['email']);
         $entryModel->setRegistration($entries['registration']);
         $entryModel->setCommercialRegister($entries['commercialregister']);
         $entryModel->setVatId($entries['vatid']);
         $entryModel->setOther($entries['other']);
         $entryModel->setDisclaimer($entries['disclaimer']);
         $imprint[] = $entryModel;
     }
     return $imprint;
 }
Exemple #2
0
 public function indexAction()
 {
     $this->getLayout()->getAdminHmenu()->add($this->getTranslator()->trans('menuImprint'), array('action' => 'index'));
     $imprintMapper = new ImprintMapper();
     $this->getView()->set('imprint', $imprintMapper->getImprintById(1));
     $this->getView()->set('imprintStyle', $this->getConfig()->get('imprint_style'));
     if ($this->getRequest()->isPost()) {
         $model = new ImprintModel();
         $model->setId(1);
         $model->setParagraph($this->getRequest()->getPost('paragraph'));
         $model->setCompany($this->getRequest()->getPost('company'));
         $model->setName($this->getRequest()->getPost('name'));
         $model->setAddress($this->getRequest()->getPost('address'));
         $model->setAddressAdd($this->getRequest()->getPost('addressadd'));
         $model->setCity($this->getRequest()->getPost('city'));
         $model->setPhone($this->getRequest()->getPost('phone'));
         $model->setFax($this->getRequest()->getPost('fax'));
         $model->setEmail($this->getRequest()->getPost('email'));
         $model->setRegistration($this->getRequest()->getPost('registration'));
         $model->setCommercialRegister($this->getRequest()->getPost('commercialregister'));
         $model->setVatId($this->getRequest()->getPost('vatid'));
         $model->setOther($this->getRequest()->getPost('other'));
         $model->setDisclaimer($this->getRequest()->getPost('disclaimer'));
         $imprintMapper->save($model);
         $this->addMessage('saveSuccess');
         $this->redirect(array('action' => 'index'));
     }
 }