summaryrefslogtreecommitdiff
path: root/app/Integration/Base.php
blob: 53f0ae8a8511c6d6fe1119db74d5f6c0c5f3ea08 (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
51
52
<?php

namespace Integration;

use Pimple\Container;

/**
 * Base class
 *
 * @package  integration
 * @author   Frederic Guillot
 *
 * @property \Model\ProjectActivity        $projectActivity
 * @property \Model\ProjectIntegration     $projectIntegration
 * @property \Model\Task                   $task
 * @property \Model\TaskFinder             $taskFinder
 * @property \Model\User                   $user
 * @property \Model\Project                $project
 */
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];
    }
}