summaryrefslogtreecommitdiff
path: root/app/Integration/Base.php
blob: c6387fe214fc0f1979ac4286bf664f41fec46365 (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
50
<?php

namespace Integration;

use Pimple\Container;

/**
 * Base class
 *
 * @package  integration
 * @author   Frederic Guillot
 *
 * @property \Model\ProjectActivity        $projectActivity
 * @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];
    }
}