Issues (52)

application/models/Wallets/Grid.php (2 issues)

Labels
Severity
1
<?php
2
3
/**
4
 * @copyright Bluz PHP Team
5
 * @link      https://github.com/bluzphp/skeleton
6
 */
7
8
namespace Application\Wallets;
9
10
use Bluz\Grid\Source\SelectSource;
0 ignored issues
show
The type Bluz\Grid\Source\SelectSource was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
12
/**
13
 * Grid based on Table
14
 *
15
 * @package  Application\Wallets
16
 *
17
 * @author   Anton Shevchuk
18
 * @created  2017-10-20 09:56:24
19
 */
20
class Grid extends \Bluz\Grid\Grid
0 ignored issues
show
The type Bluz\Grid\Grid was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
21
{
22
    /**
23
     * @var string
24
     */
25
    protected $uid = 'wallets';
26
27
    /**
28
     * @return void
29
     * @throws \Bluz\Grid\GridException
30
     */
31
    public function init(): void
32
    {
33
        // Current table as source of grid
34
        $adapter = new SelectSource();
35
        $adapter->setSource(
36
            Table::select()
37
                ->addSelect('users.login as login')
38
                ->join('wallets', 'users', 'users', 'users.id = wallets.userId')
39
        );
40
41
        $this->addAlias('users.id', 'user');
42
        $this->addAlias('users.login', 'login');
43
        $this->setAdapter($adapter);
44
        $this->setDefaultLimit(25);
45
        $this->setAllowFilters(['amount', 'blocked', 'users.id', 'users.login']);
46
        $this->setAllowOrders(['amount', 'blocked', 'users.id', 'users.login', 'created']);
47
    }
48
}
49