public function save(Entity $entity) { $item = array('title' => $entity->getTitle(), 'content' => $entity->getContent(), 'date_added' => $entity->getDateAdded()); if ($entity->getId() > 0) { $this->update($item, array('id' => $entity->getId())); } else { $this->add($item); } }
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) { $item = array('name' => $entity->getName(), 'address' => $entity->getAddress(), 'image' => $entity->getImage(), 'date_added' => $entity->getDateAdded()); if ($entity->getId() > 0) { $this->update($item, array('id' => $entity->getId())); } else { $this->add($item); } }
public function save(Entity $entity) { $item = array('user_id' => $entity->getUserId(), 'name' => $entity->getName(), 'price' => $entity->getPrice(), 'quantity' => $entity->getQuantity(), 'image' => $entity->getImage(), 'date_added' => $entity->getDateAdded()); if ($entity->getId() > 0) { $this->update($item, array('id' => $entity->getId())); } else { $this->add($item); } }
public function save(Entity $entity) { $item = array('news_id' => $entity->getNewsId(), 'user_id' => $entity->getUserId(), 'content' => $entity->getContent(), 'date_added' => $entity->getDateAdded()); if ($entity->getId() > 0) { $this->update($item, array('id' => $entity->getId())); } else { $this->add($item); } }