Session::getModel()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
/*
3
 * This file is part of the PommProject/ModelManager package.
4
 *
5
 * (c) 2014 - 2015 Grégoire HUBERT <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace PommProject\ModelManager;
11
12
use PommProject\Foundation\Session as FoundationSession;
13
use PommProject\ModelManager\Model\Model;
14
use PommProject\ModelManager\ModelLayer\ModelLayer;
15
16
/**
17
 * Session
18
 *
19
 * Model manager's session.
20
 * It adds proxy method to use model manager's poolers.
21
 *
22
 * @package   ModelManager
23
 * @copyright 2015 Grégoire HUBERT
24
 * @author    Grégoire HUBERT
25
 * @license   X11 {@link http://opensource.org/licenses/mit-license.php}
26
 *
27
 * @see FoundationSession
28
 */
29
class Session extends FoundationSession
30
{
31
    /**
32
     * getModel
33
     *
34
     * Return a model instance
35
     *
36
     * @access public
37
     * @param  string   $class
38
     * @return Model
39
     */
40
    public function getModel($class)
41
    {
42
        return $this->getClientUsingPooler('model', $class);
43
    }
44
45
    /**
46
     * getModelLayer
47
     *
48
     * Return a model layer instance
49
     *
50
     * @access public
51
     * @param  string   $class
52
     * @return ModelLayer
53
     */
54
    public function getModelLayer($class)
55
    {
56
        return $this->getClientUsingPooler('model_layer', $class);
57
    }
58
}
59