Passed
Push — master ( 2715f7...fbc634 )
by Laurent
02:37
created

app_RoleAccessSet::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 11
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 18
rs 9.9
1
<?php
2
//-------------------------------------------------------------------------
3
// OVIDENTIA http://www.ovidentia.org
4
// Ovidentia is free software; you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation; either version 2, or (at your option)
7
// any later version.
8
//
9
// This program is distributed in the hope that it will be useful, but
10
// WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
// See the GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with this program; if not, write to the Free Software
16
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
17
// USA.
18
//-------------------------------------------------------------------------
19
/**
20
 * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)
21
 * @copyright Copyright (c) 2008-2018 by CANTICO ({@link http://www.cantico.fr})
22
 * @copyright Copyright (c) 2019 by CapWelton ({@link https://www.capwelton.com})
23
 */
24
25
26
27
/**
28
 * @property ORM_StringField    $object
29
 * @property ORM_StringField    $action
30
 * @property ORM_StringField    $criterion
31
 * @property app_RoleSet        $role
32
 * @method app_RoleSet          role()
33
 *
34
 * @method app_RoleAccess   get(mixed $criteria)
35
 * @method app_RoleAccess   request(mixed $criteria)
36
 * @method app_RoleAccess[] select(\ORM_Criteria $criteria = null)
37
 * @method app_RoleAccess   newRecord()
38
 */
39
class app_RoleAccessSet extends app_RecordSet
40
{
41
    /**
42
     *
43
     * @param Func_App $App
44
     */
45
    public function __construct(Func_App $App = null)
46
    {
47
        parent::__construct($App);
0 ignored issues
show
Bug introduced by
It seems like $App can also be of type null; however, parameter $app of app_RecordSet::__construct() does only seem to accept Func_App, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

47
        parent::__construct(/** @scrutinizer ignore-type */ $App);
Loading history...
48
49
        $App = $this->App();
50
51
        $this->setPrimaryKey('id');
52
53
        $this->addFields(
54
            ORM_StringField('object')
55
                ->setDescription('Object'),
56
            ORM_StringField('action')
57
                ->setDescription('Action'),
58
            ORM_StringField('criterion')
59
                ->setDescription('Criterion')
60
        );
61
62
        $this->hasOne('role', $App->RoleSetClassName());
0 ignored issues
show
Bug introduced by
The method RoleSetClassName() does not exist on Func_App. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

62
        $this->hasOne('role', $App->/** @scrutinizer ignore-call */ RoleSetClassName());
Loading history...
63
    }
64
}
65
66
67
68
/**
69
 * @property string     $object
70
 * @property string     $action
71
 * @property string     $criterion
72
 * @property app_Role   $role
73
 * @method app_Role     role()
74
 *
75
 * @method app_RoleAccessSet getParentSet()
76
 */
77
class app_RoleAccess extends app_Record
78
{
79
}
80
81