1 | <?php |
||
22 | class Comment extends Base |
||
23 | { |
||
24 | public static $classeBuilder = CommentBuilder::class; |
||
25 | /** |
||
26 | * @inheritdoc |
||
27 | */ |
||
28 | public $timestamps = false; |
||
29 | |||
30 | /** |
||
31 | * @inheritdoc |
||
32 | */ |
||
33 | protected $fillable = [ |
||
34 | 'commentable_id', |
||
35 | 'commentable_type', |
||
36 | 'content', |
||
37 | ]; |
||
38 | |||
39 | |||
40 | protected $mappingProperties = array( |
||
41 | /** |
||
42 | * User Info |
||
43 | */ |
||
44 | 'content' => [ |
||
45 | 'type' => 'string', |
||
46 | "analyzer" => "standard", |
||
47 | ], |
||
48 | ); |
||
49 | |||
50 | /** |
||
51 | * Get the owning commentable model. |
||
52 | */ |
||
53 | public function commentable() |
||
57 | |||
58 | /** |
||
59 | * @inheritdoc |
||
60 | */ |
||
61 | protected static function boot() |
||
71 | |||
72 | /** |
||
73 | * @inheritdoc |
||
74 | */ |
||
75 | public function newEloquentBuilder($query): CommentBuilder |
||
79 | |||
80 | /** |
||
81 | * @inheritdoc |
||
82 | */ |
||
83 | public function newQuery(): CommentBuilder |
||
87 | |||
88 | // @todo Carregar Modelo Post para Blog |
||
89 | // /** |
||
90 | // * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany |
||
91 | // */ |
||
92 | // public function posts() |
||
93 | // { |
||
94 | // return $this->belongsToMany(Post::class, Tables::TABLE_POSTS_TAGS); |
||
95 | // } |
||
96 | |||
97 | /** |
||
98 | * Setter for the 'content' attribute. |
||
99 | * |
||
100 | * @param string $content |
||
101 | * @return $this |
||
102 | */ |
||
103 | public function setContentAttribute(string $content) |
||
109 | |||
110 | /** |
||
111 | * @return CommentEntity |
||
112 | */ |
||
113 | public function toEntity(): CommentEntity |
||
122 | |||
123 | // @todo fazer |
||
124 | public static function registerCommentForProject($comment, $id, $type, $projectUrl = false) |
||
168 | |||
169 | public function references() |
||
173 | |||
174 | public static function registerComents($data, $id, $type, $reference) |
||
184 | |||
185 | } |
||
186 |