Album   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 7
c 2
b 0
f 0
dl 0
loc 39
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getFileName() 0 3 1
A filesDir() 0 3 1
A getNameAttribute() 0 3 1
A getImageDimensions() 0 3 1
1
<?php
2
3
namespace FaithGen\Gallery\Models;
4
5
use FaithGen\SDK\Models\UuidModel;
6
use FaithGen\SDK\Traits\Relationships\Belongs\BelongsToMinistryTrait;
7
use FaithGen\SDK\Traits\Relationships\Morphs\CommentableTrait;
8
use FaithGen\SDK\Traits\Relationships\Morphs\ImageableTrait;
9
use FaithGen\SDK\Traits\StorageTrait;
10
use FaithGen\SDK\Traits\TitleTrait;
11
12
class Album extends UuidModel
13
{
14
    use  ImageableTrait, BelongsToMinistryTrait, StorageTrait, TitleTrait, CommentableTrait;
15
16
    protected $table = 'fg_albums';
17
18
    //****************************************************************************//
19
    //***************************** MODEL ATTRIBUTES *****************************//
20
    //****************************************************************************//
21
    public function getNameAttribute($val)
22
    {
23
        return ucwords($val);
24
    }
25
26
    //****************************************************************************//
27
    //***************************** MODEL RELATIONSHIPS *****************************//
28
    //****************************************************************************//
29
30
    /**
31
     * The name of the directory in storage that has files for this model.
32
     * @return mixed
33
     */
34
    public function filesDir()
35
    {
36
        return 'gallery';
37
    }
38
39
    /**
40
     * The file name fo this model.
41
     * @return mixed
42
     */
43
    public function getFileName()
44
    {
45
        return $this->images()->pluck('name')->toArray();
46
    }
47
48
    public function getImageDimensions()
49
    {
50
        return [0, 100];
51
    }
52
}
53