Emoji   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 7
Bugs 4 Features 0
Metric Value
wmc 3
c 7
b 4
f 0
lcom 0
cbo 1
dl 0
loc 28
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A keywords() 0 4 1
A category() 0 4 1
A created_by() 0 4 1
1
<?php
2
/**
3
 * @author   Temitope Olotin <[email protected]>
4
 * @license  <https://opensource.org/license/MIT> MIT
5
 */
6
namespace Laztopaz\EmojiRestfulAPI;
7
8
use Illuminate\Database\Eloquent\Model;
9
10
class Emoji extends Model
11
{
12
    protected $fillable = ['name', 'char', 'category', 'created_by', 'created_at', 'updated_at'];
13
14
    /**
15
     * Get emoji keywords.
16
     */
17
    public function keywords()
18
    {
19
        return $this->hasMany('Laztopaz\EmojiRestfulAPI\Keyword')->select(['emoji_id', 'keyword_name']);
20
    }
21
22
    /**
23
     * Get emoji category.
24
     */
25
    public function category()
26
    {
27
        return $this->hasOne('Laztopaz\EmojiRestfulAPI\Category', 'id', 'category')->select('id', 'category_name');
28
    }
29
30
    /**
31
     * Get emoji creator.
32
     */
33
    public function created_by()
34
    {
35
        return $this->hasOne('Laztopaz\EmojiRestfulAPI\User', 'id', 'created_by');
36
    }
37
}
38