Esempio n. 1
0
 public function save(EntityInterface $entity, $route = 'save')
 {
     $existent = $entity->getPrevious();
     if ($existent) {
         return $this->update($entity, $existent);
     }
     return $this->execute($this->factoryMap($route), $entity->toJson($route));
 }
Esempio n. 2
0
 public function save(EntityInterface $product, $route = 'save')
 {
     $existent = $product->getPrevious();
     $this->log('INFO', 'save', ['route' => $route, 'existent' => $existent]);
     if ($existent) {
         return $this->update($product, $existent);
     }
     return $this->getPool()->add($product);
 }