CompaniesGroups   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 77
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 1
Metric Value
eloc 23
c 3
b 0
f 1
dl 0
loc 77
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A initialize() 0 19 1
A getSource() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Canvas\Models;
5
6
use Phalcon\Validation;
0 ignored issues
show
Bug introduced by
The type Phalcon\Validation 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...
7
use Phalcon\Validation\Validator\PresenceOf;
0 ignored issues
show
Bug introduced by
The type Phalcon\Validation\Validator\PresenceOf 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...
8
9
/**
10
 * Class CompanyBranches.
11
 *
12
 * @package Canvas\Models
13
 *
14
 */
15
class CompaniesGroups extends AbstractModel
16
{
17
    /**
18
     *
19
     * @var integer
20
     */
21
    public $id;
22
23
    /**
24
     *
25
     * @var string
26
     */
27
    public $name;
28
29
    /**
30
     *
31
     * @var integer
32
     */
33
    public $apps_id;
34
35
    /**
36
     *
37
     * @var integer
38
     */
39
    public $users_id;
40
41
    /**
42
     *
43
     * @var string
44
     */
45
    public $created_at;
46
47
    /**
48
     *
49
     * @var string
50
     */
51
    public $updated_at;
52
53
    /**
54
     *
55
     * @var integer
56
     */
57
    public $is_deleted;
58
59
    /**
60
     * Initialize method for model.
61
     */
62
    public function initialize()
63
    {
64
        $this->setSource('companies_groups');
65
66
        $this->hasMany(
67
            'id',
68
            CompaniesAssociations::class,
69
            'companies_groups_id',
70
            ['alias' => 'companiesAssoc']
71
        );
72
73
        $this->hasManyToMany(
74
            'id',
75
            CompaniesAssociations::class,
76
            'companies_groups_id',
77
            'companies_id',
78
            Companies::class,
79
            'id',
80
            ['alias' => 'companies']
81
        );
82
    }
83
84
    /**
85
     * Returns table name mapped in the model.
86
     *
87
     * @return string
88
     */
89
    public function getSource() : string
90
    {
91
        return 'companies_groups';
92
    }
93
}
94