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

FormUpdate::before()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
rs 9.6667
cc 2
eloc 6
nc 2
nop 0
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
}