Beispiel #1
0
 public function save(Entity $entity)
 {
     $data = array('product_id' => $entity->getProductId(), 'date' => $entity->getDate(), 'name' => $entity->getName(), 'email' => $entity->getEmail(), 'phone' => $entity->getPhone(), 'is_complete' => $entity->getIsComplete(), 'user_id' => $entity->getUserId());
     if ($entity->getId() > 0) {
         $this->db->update($this->table, $data, $entity->getId());
     } else {
         $entity->setId($this->db->insert($this->table, $data));
     }
 }
Beispiel #2
0
 public function save(Entity $entity)
 {
     $item = array('product_id' => $entity->getProductId(), 'name' => $entity->getName(), 'image' => $entity->getImage(), 'is_cover' => $entity->getIsCover(), 'date_added' => $entity->getDateAdded());
     if ($entity->getId() > 0) {
         $this->update($item, array('id' => $entity->getId()));
     } else {
         $this->add($item);
     }
 }
 public function save(Entity $entity)
 {
     $data = array('product_id' => $entity->getProductId());
     if ($entity->getImage() != '') {
         $data['image'] = $entity->getImage();
     }
     if ($entity->getId() > 0) {
         $this->db->update($this->table, $data, $entity->getId());
     } else {
         $entity->setId($this->db->insert($this->table, $data));
     }
 }