Beispiel #1
0
 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);
     }
 }
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);
     }
 }
Beispiel #3
0
 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);
     }
 }
Beispiel #4
0
 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);
     }
 }
Beispiel #5
0
 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);
     }
 }