AsOrganization::bootAsOrganization()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Telefonica\Traits;
4
5
use Muleta\Traits\MakeEconomicActions;
6
// Podem Seguir
7
use Log;
8
use Muleta\Traits\Models\HasPersonality;
9
use Overtrue\LaravelFollow\Traits\CanBeFollowed;
10
use Overtrue\LaravelFollow\Traits\CanBookmark;
11
use Overtrue\LaravelFollow\Traits\CanFavorite;
12
use Overtrue\LaravelFollow\Traits\CanFollow;
13
// Podem Serem Seguidos
14
use Overtrue\LaravelFollow\Traits\CanLike;
15
16
use Overtrue\LaravelFollow\Traits\CanSubscribe;
17
use Overtrue\LaravelFollow\Traits\CanVote;
18
// use Stalker\Traits\HasPhoto;
19
use Telefonica\Traits\HasRoutine;
20
use Telefonica\Traits\HasTask;
21
22
trait AsOrganization
23
{
24
    use HasPersonality;
25
    use MakeEconomicActions, HasTask, HasRoutine;
26
    use HasServicesAndAccounts, HasContacts, AsFofocavel;
27
28
    use CanFollow, CanLike, CanFavorite, CanSubscribe, CanVote, CanBookmark;
29
    use CanBeFollowed;
30
31
    // @todo Nao precisa do Stalker -> Eu tinha removido mas voltei pq ta dando bill
32
    // use HasPhoto; 
33
34
    /**
35
     * Aparece em videos
36
     */
37
    public function videos()
38
    {
39
        return $this->morphToMany('Stalker\Models\Video', 'videoable');
40
    }
41
42
    /**
43
     * Aparece em fotos
44
     */
45
    public function imagens()
46
    {
47
        return $this->morphToMany('Stalker\Models\Imagen', 'imagenable');
48
    }
49
50
        
51
    /**
52
     * Get all of the owning personable models.
53
     */
54
    public function savePassword($password = '', $type = '')
0 ignored issues
show
Unused Code introduced by
The parameter $password is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $type is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
55
    {
56
        // @todo Fazer
57
        return true;
58
    }
59
    /**
60
     *
61
     */
62
63
    /**
64
     * Projetos do Usuario - Refazer
65
     *
66
     * @param  array $data
67
     * @return void
68
     */
69
    public function addProject($data)
70
    {
71
        // @todo Refazer
72
        return $this->infos()->create(
0 ignored issues
show
Bug introduced by
The method create cannot be called on $this->infos() (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
73
            [
74
            'text' => implode(';', $data)
75
            ]
76
        );
77
    }
78
79
    /**
80
     * Events
81
     */
82
    public static function bootAsOrganization()
83
    {
84
85
        // static::deleting(function (self $user) {
86
        //     optional($user->photos)->each(function (Photo $photo) {
87
        //         $photo->delete();
88
        //     });
89
        // });
90
    }
91
}
92