1 | <?php |
||
28 | trait UserOrganizationTrait |
||
29 | { |
||
30 | public $organizationClass = Organization::class; |
||
31 | public $departmentClass = Department::class; |
||
32 | public $memberClass = Member::class; |
||
33 | private $noInitOrganization; |
||
34 | private $noInitMember; |
||
35 | /** |
||
36 | * @return Organization |
||
37 | */ |
||
38 | protected function getNoInitOrganization() |
||
46 | /** |
||
47 | * @return Member |
||
48 | */ |
||
49 | protected function getNoInitMember() |
||
57 | |||
58 | /** |
||
59 | * |
||
60 | * @return MemberQuery |
||
61 | */ |
||
62 | public function getOfMembers() |
||
66 | |||
67 | /** |
||
68 | * |
||
69 | * @return OrganizationQuery |
||
70 | */ |
||
71 | public function getAtOrganizations() |
||
75 | |||
76 | /** |
||
77 | * Set up organization. |
||
78 | * @param string $name |
||
79 | * @param string $nickname |
||
80 | * @param integer $gravatar_type |
||
81 | * @param string $gravatar |
||
82 | * @param string $timezone |
||
83 | * @param string $description |
||
84 | * @return boolean |
||
85 | */ |
||
86 | public function setUpOrganization($name, $nickname = '', $gravatar_type = 0, $gravatar = '', $timezone = 'UTC', $description = '') |
||
109 | |||
110 | /** |
||
111 | * Set Up Department. |
||
112 | * @param BaseOrganization $organization |
||
113 | * @param type $department |
||
114 | */ |
||
115 | public function setUpDepartment($organization, $department) |
||
119 | |||
120 | /** |
||
121 | * |
||
122 | * @param string $name |
||
123 | * @param string $nickname |
||
124 | * @param string $gravatar_type |
||
125 | * @param string $gravatar |
||
126 | * @param string $timezone |
||
127 | * @param string $description |
||
128 | */ |
||
129 | public function createOrganization($name, $nickname = '', $gravatar_type = 0, $gravatar = '', $timezone = 'UTC', $description = '') |
||
146 | } |
||
147 |
This check looks for methods that are used by a trait but not required by it.
To illustrate, let’s look at the following code example
The trait
Idable
provides a methodequalsId
that in turn relies on the methodgetId()
. If this method does not exist on a class mixing in this trait, the method will fail.Adding the
getId()
as an abstract method to the trait will make sure it is available.