diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-05-24 16:02:25 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-05-24 16:02:25 -0400 |
commit | eeac2329baab1fdae7cbf6c707ed2ffd8beb4c1b (patch) | |
tree | 511c2fe47f8fbb1ea90e59e7a7a7f5e3530aa9ed /app/Core/Base.php | |
parent | 65e9e5d1bed9f88ecfd43eb2c1e780a7c22c151f (diff) |
Helpers refactoring
Diffstat (limited to 'app/Core/Base.php')
-rw-r--r-- | app/Core/Base.php | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/app/Core/Base.php b/app/Core/Base.php new file mode 100644 index 00000000..cb8e4487 --- /dev/null +++ b/app/Core/Base.php @@ -0,0 +1,110 @@ +<?php + +namespace Core; + +use Pimple\Container; + +/** + * Base class + * + * @package core + * @author Frederic Guillot + * + * @property \Core\Helper $helper + * @property \Core\HttpClient $httpClient + * @property \Core\Paginator $paginator + * @property \Core\Request $request + * @property \Core\Session $session + * @property \Core\Template $template + * @property \Integration\BitbucketWebhook $bitbucketWebhook + * @property \Integration\GithubWebhook $githubWebhook + * @property \Integration\GitlabWebhook $gitlabWebhook + * @property \Integration\HipchatWebhook $hipchatWebhook + * @property \Integration\Jabber $jabber + * @property \Integration\MailgunWebhook $mailgunWebhook + * @property \Integration\PostmarkWebhook $postmarkWebhook + * @property \Integration\SendgridWebhook $sendgridWebhook + * @property \Integration\SlackWebhook $slackWebhook + * @property \Model\Acl $acl + * @property \Model\Action $action + * @property \Model\Authentication $authentication + * @property \Model\Board $board + * @property \Model\Budget $budget + * @property \Model\Category $category + * @property \Model\Color $color + * @property \Model\Comment $comment + * @property \Model\Config $config + * @property \Model\Currency $currency + * @property \Model\DateParser $dateParser + * @property \Model\File $file + * @property \Model\HourlyRate $hourlyRate + * @property \Model\LastLogin $lastLogin + * @property \Model\Link $link + * @property \Model\Notification $notification + * @property \Model\Project $project + * @property \Model\ProjectActivity $projectActivity + * @property \Model\ProjectAnalytic $projectAnalytic + * @property \Model\ProjectDuplication $projectDuplication + * @property \Model\ProjectDailySummary $projectDailySummary + * @property \Model\ProjectIntegration $projectIntegration + * @property \Model\ProjectPermission $projectPermission + * @property \Model\Subtask $subtask + * @property \Model\SubtaskExport $subtaskExport + * @property \Model\SubtaskForecast $subtaskForecast + * @property \Model\SubtaskTimeTracking $subtaskTimeTracking + * @property \Model\Swimlane $swimlane + * @property \Model\Task $task + * @property \Model\TaskCreation $taskCreation + * @property \Model\TaskDuplication $taskDuplication + * @property \Model\TaskExport $taskExport + * @property \Model\TaskFinder $taskFinder + * @property \Model\TaskFilter $taskFilter + * @property \Model\TaskLink $taskLink + * @property \Model\TaskModification $taskModification + * @property \Model\TaskPermission $taskPermission + * @property \Model\TaskPosition $taskPosition + * @property \Model\TaskStatus $taskStatus + * @property \Model\TaskValidator $taskValidator + * @property \Model\Timetable $timetable + * @property \Model\TimetableDay $timetableDay + * @property \Model\TimetableExtra $timetableExtra + * @property \Model\TimetableOff $timetableOff + * @property \Model\TimetableWeek $timetableWeek + * @property \Model\Transition $transition + * @property \Model\User $user + * @property \Model\UserSession $userSession + * @property \Model\Webhook $webhook + */ +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 models + * + * @access public + * @param string $name Model name + * @return mixed + */ + public function __get($name) + { + return $this->container[$name]; + } +} |