Completed
Push — master ( 4d49f2...b9481e )
by Prateek
05:48 queued 03:41
created

Module::getModelName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Prateekkarki\Laragen\Models;
4
5
class Module
6
{
7
    protected $module;
8
9
    protected $data;
10
11
    protected $images;
12
13
    protected $name;
14
15
    public function __construct($module)
16
    {
17
        $this->module = (object)$module;
18
        $this->data   = $this->module->data;
19
        $this->name   = $this->module->name;
20
    }
21
22
    public function getName()
23
    {
24
        return $this->name;
25
    }
26
27
    public function getData()
28
    {
29
        return $this->data;
30
    }
31
32
    public function getModuleName()
33
    {
34
        return $this->name;
35
    }
36
37
    public function getModelName()
38
    {
39
        return ucfirst(camel_case(str_singular($this->name)));
40
    }
41
42
    public function getModelNamePlural()
43
    {
44
        return ucfirst(camel_case($this->name));
45
    }
46
}
47