1: <?php
2: namespace Define\Core;
3:
4: if(!defined('DIRECT_ACCESS')) {
5: die("Direct access is forbidden.");
6: }
7:
8: /**
9: * BASE SERVICE
10: *
11: * Base Service class that will be inherited by only service classes.
12: *
13: * @category Define
14: * @package Core
15: * @author Nitesh Apte <me@niteshapte.com>
16: * @copyright 2015 Nitesh Apte
17: * @version 1.0.0
18: * @since 1.0.0
19: * @license https://www.gnu.org/licenses/gpl.txt GNU General Public License v3
20: *
21: * This program is free software: you can redistribute it and/or modify
22: * it under the terms of the GNU General Public License as published by
23: * the Free Software Foundation, either version 3 of the License, or
24: * (at your option) any later version.
25: *
26: * This program is distributed in the hope that it will be useful,
27: * but WITHOUT ANY WARRANTY; without even the implied warranty of
28: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29: * GNU General Public License for more details.
30: *
31: * You should have received a copy of the GNU General Public License
32: * along with this program. If not, see <http://www.gnu.org/licenses/>.
33: */
34: abstract class BaseService extends BaseModel implements IBaseService {
35:
36: /**
37: * Session object
38: * @var Session $session
39: */
40: protected $session;
41:
42: /**
43: * Get the instances of the object that were stored in container.
44: *
45: * @example Session object. It might be needed in Services to set or get the values.
46: */
47: public function __construct() {
48: parent::__construct();
49: $this->session = $this->container->offsetGet('SESSION');
50: }
51: }