Example #1
0
 protected function getModel($id = null)
 {
     $model = null;
     if ($id) {
         $model = Product::findOne(["id" => $id]);
     } else {
         $model = new Product();
     }
     return $model;
 }