@param int $id
@param int $page

@return array
@throws Exception\BadResponseException
@throws ParserException
973369
public function AnimeRecentlyUpdatedByUsers(int $id, int $page = 1): array
    {
        return $this->myanimelist->getAnimeRecentlyUpdatedByUsers(
            new Request\Anime\AnimeRecentlyUpdatedByUsersRequest($id, $page)
        );
    }
1354329
public function edit($id)
    {
        $filters = [];
//        // handle permission
//        $filters = $this->handlePermission(__FUNCTION__);

        // Create Response Model
        $response = new ResponseModel();

        try {
            $response->setMessage($this->getTrans('edit', 'successful'));

            // add filter to get desired record
            array_push($filters,
                [$this->model->getKeyName(), '=', $id]
            );
            $data = $this->model
                ->where($filters)
                ->with(collect($this->editLoad)->count() == 0 ? $this->indexLoad : $this->editLoad)
                ->get();
            $response->setData($data);

        } catch (ModelNotFoundException $exception) {
            $response->setError($exception->getCode());
            $response->setMessage($this->getTrans('edit', 'failed'));
            $response->setStatus(false);
            if (env('APP_DEBUG', false)) {
                $response->setData(collect($exception->getMessage()));
            }

        }

        return SmartResponse::response($response);
    }
55946
public function run($id)
    {
        if (!Yii::$app->request->isPost) {
            throw new MethodNotAllowedHttpException('Method Not Allowed. This url can only handle post');
        }
        $position = Yii::$app->request->getQueryParam($this->positionParam, null);
        if (empty($position)) {
            throw new BadRequestHttpException(Yii::t('yii', '{attribute} cannot be blank.', ['attribute' => $this->positionParam]));
        }

        $model = $this->findModel($id);

        $this->positionModel($model, $position);

        return $this->respondSuccess($model);
    }
812601
public function index($id = null): Response
    {
        if ($id != null) {
            return $this->getById($id);
        }

        //parse the rquest
        $parse = new QueryParserCustomFields($this->request->getQuery(), $this->model);
        $parse->appendParams($this->additionalSearchFields);
        $parse->appendCustomParams($this->additionalCustomSearchFields);
        $parse->appendRelationParams($this->additionalRelationSearchFields);
        $params = $parse->request();

        $results = (new SimpleRecords(null, $this->model, $this->model->getReadConnection()->query($params['sql'], $params['bind'])));
        $count = $this->model->getReadConnection()->query($params['countSql'], $params['bind'])->fetch(\PDO::FETCH_OBJ)->total;
        $relationships = false;

        // Relationships, but we have to change it to sparo full implementation
        if ($this->request->hasQuery('relationships')) {
            $relationships = $this->request->getQuery('relationships', 'string');
        }

        //navigate los records
        $newResult = [];
        foreach ($results as $key => $record) {
            //field the object
            foreach ($record->getAllCustomFields() as $key => $value) {
                $record->{$key} = $value;
            }

            $newResult[] = !$relationships ? $record->toFullArray() : QueryParserCustomFields::parseRelationShips($relationships, $record);
        }

        unset($results);

        //this means the want the response in a vuejs format
        if ($this->request->hasQuery('format')) {
            $limit = (int)$this->request->getQuery('limit', 'int', 25);

            $newResult = [
                'data' => $newResult,
                'limit' => $limit,
                'page' => $this->request->getQuery('page', 'int', 1),
                'total_pages' => ceil($count / $limit)
            ];
        }

        return $this->response($newResult);
    }
879084
public function handleDelete(int $id = null)
    {
        if ($id === null) {
            if (isset($_GET['template']) === false) {
                return redirect($this->router->generate('pages-list-page') . "?m=2");
            } else {
                return 'Redirect: ' . $this->router->generate('pages-list-page') . "?m=2";
            }
        }
        $page = $this->core->api('Page/' . $id, 'DELETE')->run();
        if ($page['headers'][0][2] === 422) {
            if (isset($_GET['template']) === false) {
                return redirect($this->router->generate('pages-list-page') . "?m=2");
            } else {
                return 'Redirect: ' . $this->router->generate('pages-list-page') . "?m=2";
            }
        } elseif (($page["headers"][0][2] - 200) * ($page["headers"][0][2] - 299) > 0) {
            if (headers_sent() === false) {
                foreach ($page["headers"] as $header) {
                    header($header[0], $header[1], $header[2]);
                }
            }
            return $this->templates->render("500", [
                "error" => $page['response'],
                "result" => ''
            ]);
        }

        if (isset($_GET['template']) === false) {
            return redirect($this->router->generate('pages-list-page') . "?m=1");
        } else {
            return 'Redirect: ' . $this->router->generate('pages-list-page') . "?m=1";
        }
    }
1098917
public function Magazine(int $id, int $page = 1): Model\Magazine\Magazine
    {
        return $this->myanimelist->getMagazine(
            new Request\Magazine\MagazineRequest($id, $page)
        );
    }
1234948
public function updatePage($page_id)
    {
        $data = [
            "name" => request()->name,
            "description" => request()->description,
            "amount" => request()->amount
        ];

        $this->setRequestOptions();
        return $this->setHttpResponse('/page/'.$page_id, 'PUT', $data)->getResponse();
    }
1194751
public function MangaForum(int $id): array
    {
        return $this->myanimelist->getMangaForum(
            new Request\Manga\MangaForumRequest($id)
        );
    }
1202038
public function getGuildMember4GuildId($id, $page = 1)
    {
        $memberList = $this->getGuildMemberList4GuildId($id);

        $result = null;
        if ($memberList) {
            $result = $this->getPaginator4QueryBuilder($memberList, $page);
        }

        return $result;
    }
103824
private function _getPage($ids)
    {
        $object = $this->_pager['object'];
        $method = $this->_pager['method'];
        $methodArgs = [];
        foreach ($this->_pager['methodArgs'] as $arg) {
            array_push($methodArgs, $arg);
        }
        array_push($methodArgs, $ids);

        return call_user_func_array(
            [$object, $method],
            $methodArgs
        );
    }
889990
public function view($id)
    {
        $component = $this->processor->view($id);

        return response($component['component']->__toString(), 200);
    }
1047397
public function get($id)
    {
        return $this->_sendPayload(
            $this->_getService($this->_pageServiceKey)->getActiveTemplateSections($id)
        );
    }
971017
public function actionViewAjax($id)
    {
        $model = Article::findOne($id);
        if( $model === null ) throw new NotFoundHttpException("None exists article id");
        return [
            'likeCount' => (int)$model->getArticleLikeCount(),
            'scanCount' => $model->scan_count * 100,
            'commentCount' => $model->comment_count,
        ];
    }
126556
public function actionDelete($id, $page = 1)
    {
        $model = $this->findModel($id);
/* moved to model:
        $subdir = $this->module->model('News')->getImageSubdir($model->id);
        $fullDir = $this->uploadsNewsDir . '/' . $subdir;//var_dump($fullDir);exit;
        if (is_dir($fullDir)) {
            @FileHelper::removeDirectory($fullDir);
        }
*/
        $model->delete(); // images and i18n-deletions also in main model

        Yii::$app->session->setFlash('success', Yii::t($this->tcModule, 'Record with ID={id} delete success', ['id' => $id]));

        $searchFormName = basename(NewsSearch::className());
        $paramSort = Yii::$app->request->get($searchFormName, []);
        foreach ($paramSort as $key => $val) {
            if (empty($val)) unset($paramSort[$key]);
        }
        return $this->redirect(['index',
            'page' => $page,
            $searchFormName => $paramSort,
            'sort' => $model->orderBy,
        ]);
    }
266402
public function actionIndex($page = 1, $id = 0)
    {
        $searchModel = $this->module->model('UserSearch');
        $params = Yii::$app->request->queryParams;
        $dataProvider = $searchModel->search($params);

        $pager = $dataProvider->getPagination();
        $pager->pageSize = intval($this->module->params['pageSizeAdmin']);
        $pager->totalCount = $dataProvider->getTotalCount();

        // page number correction
        $maxPage = ceil($pager->totalCount / $pager->pageSize);
        if ($page > $maxPage) {
            $pager->page = $maxPage - 1;
        } else {
            $pager->page = $page - 1; //! from 0
        }

        return $this->render('index', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
            'currentId'    => $id,
        ]);
    }
685226
public function get($id)
    {
        return $this->_sendPayload(
            $this->_getService($this->_pageServiceKey)->getTemplateLayout($id)
        );
    }
523520
public function getDelete(Page $page)
    {
        $this->authorize('delete', $page);

        return view($this->viewPrefix.'.delete', [
            'children' => $page->countChildren(),
            'page'     => $page,
        ]);
    }