Manager.php
3.52 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<?php
namespace Phalcon\Mvc\Collection {
/**
* Phalcon\Mvc\Collection\Manager
*
* This components controls the initialization of models, keeping record of relations
* between the different models of the application.
*
* A CollectionManager is injected to a model via a Dependency Injector Container such as Phalcon\DI.
*
* <code>
* $di = new Phalcon\DI();
*
* $di->set('collectionManager', function(){
* return new Phalcon\Mvc\Collection\Manager();
* });
*
* $robot = new Robots($di);
* </code>
*/
class Manager implements \Phalcon\DI\InjectionAwareInterface, \Phalcon\Events\EventsAwareInterface {
protected $_dependencyInjector;
protected $_initialized;
protected $_lastInitialized;
protected $_eventsManager;
protected $_customEventsManager;
protected $_connectionServices;
protected $_implicitObjectsIds;
/**
* Sets the DependencyInjector container
*
* @param \Phalcon\DiInterface $dependencyInjector
*/
public function setDI($dependencyInjector){ }
/**
* Returns the DependencyInjector container
*
* @return \Phalcon\DiInterface
*/
public function getDI(){ }
/**
* Sets the event manager
*
* @param \Phalcon\Events\ManagerInterface $eventsManager
*/
public function setEventsManager($eventsManager){ }
/**
* Returns the internal event manager
*
* @return \Phalcon\Events\ManagerInterface
*/
public function getEventsManager(){ }
/**
* Sets a custom events manager for a specific model
*
* @param \Phalcon\Mvc\CollectionInterface $model
* @param \Phalcon\Events\ManagerInterface $eventsManager
*/
public function setCustomEventsManager($model, $eventsManager){ }
/**
* Returns a custom events manager related to a model
*
* @param \Phalcon\Mvc\CollectionInterface $model
* @return \Phalcon\Events\ManagerInterface
*/
public function getCustomEventsManager($model){ }
/**
* Initializes a model in the models manager
*
* @param \Phalcon\Mvc\CollectionInterface $model
*/
public function initialize($model){ }
/**
* Check whether a model is already initialized
*
* @param string $modelName
* @return bool
*/
public function isInitialized($modelName){ }
/**
* Get the latest initialized model
*
* @return \Phalcon\Mvc\CollectionInterface
*/
public function getLastInitialized(){ }
/**
* Sets a connection service for a specific model
*
* @param \Phalcon\Mvc\CollectionInterface $model
* @param string $connectionService
*/
public function setConnectionService($model, $connectionService){ }
/**
* Sets if a model must use implicit objects ids
*
* @param \Phalcon\Mvc\CollectionInterface $model
* @param boolean $useImplicitObjectIds
*/
public function useImplicitObjectIds($model, $useImplicitObjectIds){ }
/**
* Checks if a model is using implicit object ids
*
* @param \Phalcon\Mvc\CollectionInterface $model
* @return boolean
*/
public function isUsingImplicitObjectIds($model){ }
/**
* Returns the connection related to a model
*
* @param \Phalcon\Mvc\CollectionInterface $model
* @return \Phalcon\Db\AdapterInterface
*/
public function getConnection($model){ }
/**
* Receives events generated in the models and dispatches them to a events-manager if available
* Notify the behaviors that are listening in the model
*
* @param string $eventName
* @param \Phalcon\Mvc\CollectionInterface $model
*/
public function notifyEvent($eventName, $model){ }
}
}