/** * @param $id * @throws HttpException */ protected function findModel($id) { if (is_array($id)) { $model = StoreProduct::findIdentities($id); } else { $model = StoreProduct::findIdentity($id); } if ($model !== null) { return $model; } else { throw new HttpException(404); } }