Completed
Push — develop-3.0 ( 360277...bd5ff0 )
by Mohamed
06:52
created

FetchRoleTrait::getRoleNameDropdown()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 0
1
<?php
2
/*
3
 * This file is part of the site package.
4
 *
5
 * (c) Mohamed Alsharaf <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Tinyissue\Extensions\Model;
12
13
use Illuminate\Database\Eloquent\Collection;
14
use Tinyissue\Model\Role;
15
16
/**
17
 * FetchRoleTrait is trait class contains method to set and fetch roles.
18
 *
19
 * @author Mohamed Alsharaf <[email protected]>
20
 */
21
trait FetchRoleTrait
22
{
23
    /**
24
     * Collection of all tags.
25
     *
26
     * @var array
27
     */
28
    protected $roles = null;
29
30
    /**
31
     * @return array
32
     */
33
    protected function getRoleNameDropdown()
34
    {
35
        if (is_null($this->roles)) {
36
            $this->roles = (new Role())->getNameDropdown();
37
        }
38
39
        return $this->roles;
40
    }
41
}
42