frontend/controllers/TransactionController.php
/**
     * Renders list of user's transactions
     *
     * @return mixed
     */
Renders list of user's transactions
@return mixed
Renders list of user ' s transactions @return mixed
public function actionIndex ()
    {
        $pageRepo = Yii::$container->get('common\repositories\PagesRepository');
        $pageMeta = $pageRepo->getPageMetaData('transaction');
        $pageTitle = $pageRepo->getPageTitle('transaction');
        $user = Yii::$app->user->identity;
        $tranQuery = $user->getTransactions()->where(['type' => Transaction::TYPE_OUTGOING]);
        $tranCountQuery = clone $tranQuery;
        $pagination = new Pagination([
            'defaultPageSize' => 10,
            'totalCount' => $tranCountQuery->count(),
            'route' => Yii::getAlias('@profile_my_transactions')
        ]);
        $tranQuery->orderBy(['timestamp' => SORT_DESC]);
        $tranQuery->offset($pagination->offset);
        $tranQuery->limit($pagination->limit);
        $this->layout = 'site';
        return $this->render('index', [
            'transactions' => $tranQuery->all(),
            'pag' => $pagination,
            'title'=>$pageTitle,
            'meta'=>$pageMeta
        ]);
    }
public function actionIndex ( ) { $ pageRepo = Yii :: $ container -> get ( 'common\repositories\PagesRepository' ) ; $ pageMeta = $ pageRepo -> getPageMetaData ( 'transaction' ) ; $ pageTitle = $ pageRepo -> getPageTitle ( 'transaction' ) ; $ user = Yii :: $ app -> user -> identity ; $ tranQuery = $ user -> getTransactions ( ) -> where ( [ 'type' => Transaction :: TYPE_OUTGOING ] ) ; $ tranCountQuery = clone $ tranQuery ; $ pagination = new Pagination ( [ 'defaultPageSize' => 10 , 'totalCount' => $ tranCountQuery -> count ( ) , 'route' => Yii :: getAlias ( '@profile_my_transactions' ) ] ) ; $ tranQuery -> orderBy ( [ 'timestamp' => SORT_DESC ] ) ; $ tranQuery -> offset ( $ pagination -> offset ) ; $ tranQuery -> limit ( $ pagination -> limit ) ; $ this -> layout = 'site' ; return $ this -> render ( 'index' , [ 'transactions' => $ tranQuery -> all ( ) , 'pag' => $ pagination , 'title' => $ pageTitle , 'meta' => $ pageMeta ] ) ; }
Renders list of user's transactions
 @return mixed
Renders list of user ' s transactions @return mixed