summaryrefslogtreecommitdiff
path: root/app/Integration/Base.php
blob: babf8c8f438e5e34badf68461b8653e1ee77e684 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php

namespace Integration;

use Pimple\Container;

/**
 * Base class
 *
 * @package  integration
 * @author   Frederic Guillot
 *
 * @property \Model\Task                   $task
 * @property \Model\TaskFinder             $taskFinder
 * @property \Model\User                   $user
 */
abstract class Base
{
    /**
     * Container instance
     *
     * @access protected
     * @var \Pimple\Container
     */
    protected $container;

    /**
     * Constructor
     *
     * @access public
     * @param  \Pimple\Container   $container
     */
    public function __construct(Container $container)
    {
        $this->container = $container;
    }

    /**
     * Load automatically class from the container
     *
     * @access public
     * @param  string $name
     * @return mixed
     */
    public function __get($name)
    {
        return $this->container[$name];
    }
}