public function setCreatedBy(\Users $createdBy) { $this->__load(); return parent::setCreatedBy($createdBy); }
public function addItemUnitAction() { $form = new Form_Iadmin_Products(); if ($this->_request->isPost()) { if ($form->isValid($this->_request->getPost())) { $items = new ItemUnits(); $items->setItemUnitName($form->item_unit_name->getValue()); $items->setStatus('1'); $createdBy = $this->_em->getRepository('Users')->find($this->_userid); $items->setCreatedBy($createdBy); $items->setModifiedBy($createdBy); $items->setCreatedDate(App_Tools_Time::now()); $items->setModifiedDate(App_Tools_Time::now()); $this->_em->persist($items); $this->_em->flush(); } } $this->_redirect("/iadmin/manage-products/item-units"); }