Service.php
2.13 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?php 
namespace Phalcon\DI {
	/**
	 * Phalcon\DI\Service
	 *
	 * Represents individually a service in the services container
	 *
	 *<code>
	 * $service = new Phalcon\DI\Service('request', 'Phalcon\Http\Request');
	 * $request = $service->resolve();
	 *<code>
	 *
	 */
	
	class Service implements \Phalcon\DI\ServiceInterface {
		protected $_name;
		protected $_definition;
		protected $_shared;
		protected $_sharedInstance;
		/**
		 * \Phalcon\DI\Service
		 *
		 * @param string $name
		 * @param mixed $definition
		 * @param boolean $shared
		 */
		public function __construct($name, $definition, $shared=null){ }
		/**
		 * Returns the service's name
		 *
		 * @param string
		 */
		public function getName(){ }
		/**
		 * Sets if the service is shared or not
		 *
		 * @param boolean $shared
		 */
		public function setShared($shared){ }
		/**
		 * Check whether the service is shared or not
		 *
		 * @return boolean
		 */
		public function isShared(){ }
		/**
		 * Sets/Resets the shared instance related to the service
		 *
		 * @param mixed $sharedInstance
		 */
		public function setSharedInstance($sharedInstance){ }
		/**
		 * Set the service definition
		 *
		 * @param mixed $definition
		 */
		public function setDefinition($definition){ }
		/**
		 * Returns the service definition
		 *
		 * @return mixed
		 */
		public function getDefinition(){ }
		/**
		 * Resolves the service
		 *
		 * @param array $parameters
		 * @param \Phalcon\DiInterface $dependencyInjector
		 * @return mixed
		 */
		public function resolve($parameters=null, $dependencyInjector=null){ }
		/**
		 * Changes a parameter in the definition without resolve the service
		 *
		 * @param long $position
		 * @param array $parameter
		 * @return \Phalcon\DI\Service
		 */
		public function setParameter($position, $parameter){ }
		/**
		 * Returns a parameter in a specific position
		 *
		 * @param int $position
		 * @return array
		 */
		public function getParameter($position){ }
		/**
		 * Restore the internal state of a service
		 *
		 * @param array $attributes
		 * @return \Phalcon\DI\Service
		 */
		public static function __set_state($attributes){ }
	}
}