CompaniesAssociations   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
eloc 18
c 2
b 0
f 1
dl 0
loc 62
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A initialize() 0 16 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 CompaniesAssociations extends AbstractModel
16
{
17
    /**
18
     *
19
     * @var integer
20
     */
21
    public $companies_groups_id;
22
23
    /**
24
     *
25
     * @var integer
26
     */
27
    public $companies_id;
28
29
    /**
30
     *
31
     * @var string
32
     */
33
    public $created_at;
34
35
    /**
36
     *
37
     * @var string
38
     */
39
    public $updated_at;
40
41
    /**
42
     *
43
     * @var integer
44
     */
45
    public $is_deleted;
46
47
    /**
48
     * Initialize method for model.
49
     */
50
    public function initialize()
51
    {
52
        $this->setSource('companies_associations');
53
54
        $this->belongsTo(
55
            'companies_id',
56
            Companies::class,
57
            'id',
58
            ['alias' => 'companies']
59
        );
60
61
        $this->belongsTo(
62
            'companies_groups_id',
63
            CompaniesGroups::class,
64
            'id',
65
            ['alias' => 'companiesGroups']
66
        );
67
    }
68
69
    /**
70
     * Returns table name mapped in the model.
71
     *
72
     * @return string
73
     */
74
    public function getSource() : string
75
    {
76
        return 'companies_associations';
77
    }
78
}
79