예제 #1
0
 public function addItemCategory(ItemCategories $itemCategories)
 {
     $itemCategories->setCategory($this);
     $this->ItemCategories->add($itemCategories);
 }
 public function getCreatedBy()
 {
     $this->__load();
     return parent::getCreatedBy();
 }
 public function addItemCategoryAction()
 {
     $form = new Form_Iadmin_Products();
     if ($this->_request->isPost()) {
         if ($form->isValid($this->_request->getPost())) {
             $item_category = new ItemCategories();
             $item_category->setItemCategoryName($form->item_category_name->getValue());
             $createdBy = $this->_em->getRepository('Users')->find($this->_userid);
             $item_category->setCreatedBy($createdBy);
             $modifiedBy = $this->_em->getRepository('Users')->find($this->_userid);
             $item_category->setModifiedBy($modifiedBy);
             $this->_em->persist($item_category);
             $this->_em->flush();
         }
     }
     $this->_redirect("/iadmin/manage-products/item-categories");
 }
 public function addItemCategoryAction()
 {
     $form = new Form_Iadmin_Products();
     if ($this->_request->isPost()) {
         if ($form->isValid($this->_request->getPost())) {
             $status = '1';
             // Default status is 1.
             $item_category = new ItemCategories();
             $item_category->setItemCategoryName($form->item_category_name->getValue());
             $user_id = $this->_em->getRepository('Users')->find($this->_userid);
             $item_category->setCreatedBy($user_id);
             $item_category->setModifiedBy($user_id);
             $item_category->setStatus($status);
             $item_category->setCreatedDate(App_Tools_Time::now());
             $item_category->setModifiedDate(App_Tools_Time::now());
             $this->_em->persist($item_category);
             $this->_em->flush();
         }
     }
     $this->_redirect("/iadmin/manage-products/item-categories");
 }
 public function getModifiedBy()
 {
     $this->__load();
     return parent::getModifiedBy();
 }