Ejemplo n.º 1
0
 /**
  * @param AbstractModel $model
  */
 protected function internalSave(AbstractModel $model)
 {
     $pKey = $this->getPrimaryKey();
     if (isset($model->id)) {
         $this->tableGateway->update($model->toArray(), [$pKey => $model->{$pKey}]);
     } else {
         $this->tableGateway->insert($model->toArray());
         $id = $this->tableGateway->getLastInsertValue();
         $model->{$pKey} = $id;
     }
 }