Get a single report data

@param int            $id
@param int|null       $limit
@param int|null       $page
@param \DateTime|null $dateFrom
@param \DateTime|null $dateTo

@return array|mixed
165076
public function get($id, $limit = null, $page = null, \DateTime $dateFrom = null, \DateTime $dateTo = null)
    {
        $options = array();

        if ($limit) {
            $options['limit'] = (int) $limit;
        }

        if ($page) {
            $options['page'] = (int) $page;
        }

        if ($dateFrom) {
            $options['dateFrom'] = $dateFrom->format('c');
        }

        if ($dateTo) {
            $options['dateTo'] = $dateTo->format('c');
        }

        return $this->makeRequest("{$this->endpoint}/$id", $options);
    }
1269705
public function get($id)
	{
		$this->getResponse()
			->setStatusCode(Response::STATUS_CODE_200);
		
		$classifiedService = $this->getServiceLocator()->get('document.service.classified');
		
		try {
			$data = $classifiedService->get($id);
		} catch(\Exception $e) {
			$this->getResponse()
				->setStatusCode(Response::STATUS_CODE_500);
			$data = new \StdClass();
		}
		
		return new JsonModel(array(
			'data' => $data
		));
	}
522577
public function findAllWithoutFetchPaged($page = 0, $limit = 20) {
    $offset = $page * $limit;
    $results = $this->createQuery()
      ->setFirstResult($offset)
      ->setMaxResults($limit)
      ->execute();
    return $results;
  }
401521
public function getDataById($id)
    {
        $id = (int)$id;
        return array_key_exists($id, $this->_data) ? $this->_data[$id] : null;
    }
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,
        ]);
    }
577087
protected function findModel($id)
    {
        if (($model = Message::find()
                ->where(['id' => $id, 'parent' => null])->andWhere(['or', ['from_id' => Yii::$app->user->id], ['user_id' => Yii::$app->user->id]])->limit(1)->one()) !== null
        ) {
            return $model;
        } else {
            throw new NotFoundHttpException (Yii::t('message', 'The requested page does not exist.'));
        }
    }
896165
public function getAll(int $page = 1, int $limit = 25)
    {
        return $this->match(new Criteria([], [], ($page - 1) * $limit, $limit));
    }
285388
public function get($id) {
		// Open the file
		$path = $this->preparePath($id);
		$file = $this->openFile($path);
		
		if ($file === false) { // File is absent or is expired
			return;
		}
		
		// Process the data
		$data = $this->getData($file, $path);
		
		fclose($file);
		
		return $data;
	}
132681
public function getLastVersion($page_id)
	{
		$qb = $this->createQueryBuilder('p');
		
		$qb->where('p.original=:page_id')
			->orderBy('p.createdAt', 'DESC')
			->setParameter(':page_id', $page_id);
		
		$result = $qb->getQuery()->setMaxResults(1)->getResult();

		if ( is_null($result) ) {
			$qb2 = $this->createQueryBuilder('p');
			$qb2->where('p.id=:page_id')->setParameter(':page_id', $page_id);
			
			$result = $qb->getQuery()->getResult();
		}
		
		return $result[0];
	}
39257
public function getPager(array $criteria, $page, $limit = 10, array $sort = [])
    {
        $qb = $this->getDocumentManager()->getRepository($this->class)
            ->createQueryBuilder()
            ->sort('createdAt', 'desc');

        $criteria['status'] = $criteria['status'] ?? CommentInterface::STATUS_VALID;
        $qb->field('status')->equals($criteria['status']);

        if (isset($criteria['postId'])) {
            $qb->field('post')->equals($criteria['postId']);
        }

        $pager = new Pager(500); // no limit
        $pager->setQuery(new ProxyQuery($qb));
        $pager->setPage($page);
        $pager->init();

        return $pager;
    }
794756
public function getById($id) : Response
    {
        //find the info
        $user = $this->model->findFirst([
            'id = ?0 AND is_deleted = 0',
            'bind' => [$this->userData->getId()],
        ]);

        $user->password = null;

        //get relationship
        if ($this->request->hasQuery('relationships')) {
            $relationships = $this->request->getQuery('relationships', 'string');

            $user = QueryParser::parseRelationShips($relationships, $user);
        }

        if ($user) {
            return $this->response($user);
        } else {
            throw new Exception('Record not found');
        }
    }
859633
public function getModel($id)
    {
        if (!is_array($id)) {
            $id = [$id];
        }

        $model = call_user_func($this->findModel, $id);
        if ($model === null) {
            throw new NotFoundHttpException('The requested page does not exist.');
        }

        return $model;
    }
1236857
public function getPage($page = 1, $limit = 10)
    {
        $options = [
            'builder' => $this,
            'limit'   => $limit,
            'page'    => $page,
        ];

        return $this->getDI()->get(Paginator::class, [$options]);
    }
808971
public function actionSuggest($id=null, $limit=10) 
	{
		if($id == null) {
			$term = Yii::app()->getRequest()->getParam('term');
			if($term) {
				$criteria = new CDbCriteria;
				$criteria->select = "country_id, country_name";
				$criteria->condition = 'country_name LIKE :country';
				$criteria->params = array(':country' => '%' . strtolower($term) . '%');
				$criteria->order = "country_id ASC";
				$criteria->limit = $limit;
				$model = OmmuZoneCountry::model()->findAll($criteria);

				if($model) {
					foreach($model as $items) {
						$result[] = array('id' => $items->country_id, 'value' => $items->country_name);
					}
				}
			}
			echo CJSON::encode($result);
			Yii::app()->end();
			
		} else {
			$model = OmmuZoneCountry::getCountry();
			$message['data'] = '<option value="">'.Yii::t('phrase', 'Select one').'</option>';
			foreach($model as $key => $val) {
				$message['data'] .= '<option value="'.$key.'">'.$val.'</option>';
			}
			echo CJSON::encode($message);			
		}
	}
106373
public function get($for, $for_id, $limit = false)
	{
		return $this->model->whereFor($for)->whereForId($for_id)->orderBy('created_at', 'desc')->take($limit)->get();
	}
137700
public function getPagedResults($limit = 25, $page = 0)
    {
        $template = self::DQL_ALL;
        $dql = sprintf($template, Application::class);

        return $this->getPaginator($dql, $limit, $page, []);
    }
976499
public function getByPage($page = 1, $limit = 10, $with = array())
    {
        $result = new StdClass;
        $result->page = $page;
        $result->limit = $limit;
        $result->totalItems = 0;
        $result->items = array();

        $query = $this->make($with);
        $users = $query->skip($limit * ($page - 1))
            ->take($limit)
            ->get();
        $result->totalItems = $this->model->count();
        $result->items = $users->all();

        return $result;
    }