Passed
Push — master ( 29baaf...069627 )
by Mihail
06:51
created

FormUpdate::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4286
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace Apps\Model\Admin\Application;
4
5
use Ffcms\Core\Arch\Model;
6
use Ffcms\Core\Exception\NotFoundException;
7
8
class FormUpdate extends Model
9
{
10
    private $_controller;
11
    private $_object;
12
13
    public function __construct($controller)
14
    {
15
        $this->_controller = $controller;
16
        parent::__construct();
17
    }
18
19
    /**
20
    * Magic method before example
21
    */
22
    public function before()
23
    {
24
        $class = 'Apps\Controller\Admin\\' . $this->_controller;
25
        if (class_exists($class)) {
26
            $this->_object = new $class;
27
        } else {
28
            throw new NotFoundException('Admin controller is not founded - %c%', ['c' => $this->_controller]);
29
        }
30
    }
31
32
    public function make()
33
    {
34
35
    }
36
}