| @@ 146-178 (lines=33) @@ | ||
| 143 | { |
|
| 144 | } |
|
| 145 | ||
| 146 | protected function collectionManagement(Application $app) |
|
| 147 | { |
|
| 148 | $app['arangodb.collection'] = $app->protect( |
|
| 149 | function (array $data = []) use ($app) { |
|
| 150 | if (!empty($data)) { |
|
| 151 | return Collection::createFromArray($data); |
|
| 152 | } |
|
| 153 | ||
| 154 | return new Collection(); |
|
| 155 | } |
|
| 156 | ); |
|
| 157 | ||
| 158 | $app['arangodb.collection_handler'] = $app->share( |
|
| 159 | function ($app) { |
|
| 160 | $db = $app['arangodb']; |
|
| 161 | ||
| 162 | return new CollectionHandler($db); |
|
| 163 | } |
|
| 164 | ); |
|
| 165 | ||
| 166 | $app['arangodbs.collection_handler'] = $app->share( |
|
| 167 | function ($app) { |
|
| 168 | $app['arangodbs.options.initializer'](); |
|
| 169 | ||
| 170 | $handlers = new \Pimple(); |
|
| 171 | foreach ($app['arangodbs.options'] as $name => $options) { |
|
| 172 | $handlers[$name] = new CollectionHandler($app['arangodbs'][$name]); |
|
| 173 | } |
|
| 174 | ||
| 175 | return $handlers; |
|
| 176 | } |
|
| 177 | ); |
|
| 178 | } |
|
| 179 | ||
| 180 | protected function documentManagement(Application $app) |
|
| 181 | { |
|
| @@ 180-211 (lines=32) @@ | ||
| 177 | ); |
|
| 178 | } |
|
| 179 | ||
| 180 | protected function documentManagement(Application $app) |
|
| 181 | { |
|
| 182 | $app['arangodb.document'] = $app->protect( |
|
| 183 | function (array $data = []) use ($app) { |
|
| 184 | if (!empty($data)) { |
|
| 185 | return Document::createFromArray($data); |
|
| 186 | } |
|
| 187 | return new Document(); |
|
| 188 | } |
|
| 189 | ); |
|
| 190 | ||
| 191 | $app['arangodb.document_handler'] = $app->share( |
|
| 192 | function ($app) { |
|
| 193 | $db = $app['arangodb']; |
|
| 194 | ||
| 195 | return new DocumentHandler($db); |
|
| 196 | } |
|
| 197 | ); |
|
| 198 | ||
| 199 | $app['arangodbs.document_handler'] = $app->share( |
|
| 200 | function ($app) { |
|
| 201 | $app['arangodbs.options.initializer'](); |
|
| 202 | ||
| 203 | $handlers = new \Pimple(); |
|
| 204 | foreach ($app['arangodbs.options'] as $name => $options) { |
|
| 205 | $handlers[$name] = new DocumentHandler($app['arangodbs'][$name]); |
|
| 206 | } |
|
| 207 | ||
| 208 | return $handlers; |
|
| 209 | } |
|
| 210 | ); |
|
| 211 | } |
|
| 212 | ||
| 213 | protected function edgeManagement(Application $app) |
|
| 214 | { |
|
| @@ 213-245 (lines=33) @@ | ||
| 210 | ); |
|
| 211 | } |
|
| 212 | ||
| 213 | protected function edgeManagement(Application $app) |
|
| 214 | { |
|
| 215 | $app['arangodb.edge'] = $app->protect( |
|
| 216 | function (array $data = []) use ($app) { |
|
| 217 | if (!empty($data)) { |
|
| 218 | return Edge::createFromArray($data); |
|
| 219 | } |
|
| 220 | ||
| 221 | return new Edge(); |
|
| 222 | } |
|
| 223 | ); |
|
| 224 | ||
| 225 | $app['arangodb.edge_handler'] = $app->share( |
|
| 226 | function ($app) { |
|
| 227 | $db = $app['arangodb']; |
|
| 228 | ||
| 229 | return new EdgeHandler($db); |
|
| 230 | } |
|
| 231 | ); |
|
| 232 | ||
| 233 | $app['arangodbs.edge_handler'] = $app->share( |
|
| 234 | function ($app) { |
|
| 235 | $app['arangodbs.options.initializer'](); |
|
| 236 | ||
| 237 | $handlers = new \Pimple(); |
|
| 238 | foreach ($app['arangodbs.options'] as $name => $options) { |
|
| 239 | $handlers[$name] = new EdgeHandler($app['arangodbs'][$name]); |
|
| 240 | } |
|
| 241 | ||
| 242 | return $handlers; |
|
| 243 | } |
|
| 244 | ); |
|
| 245 | } |
|
| 246 | ||
| 247 | protected function graphManagement(Application $app) |
|
| 248 | { |
|
| @@ 247-279 (lines=33) @@ | ||
| 244 | ); |
|
| 245 | } |
|
| 246 | ||
| 247 | protected function graphManagement(Application $app) |
|
| 248 | { |
|
| 249 | $app['arangodb.graph'] = $app->protect( |
|
| 250 | function (array $data = []) use ($app) { |
|
| 251 | if (!empty($data)) { |
|
| 252 | return Graph::createFromArray($data); |
|
| 253 | } |
|
| 254 | ||
| 255 | return new Graph(); |
|
| 256 | } |
|
| 257 | ); |
|
| 258 | ||
| 259 | $app['arangodb.graph_handler'] = $app->share( |
|
| 260 | function ($app) { |
|
| 261 | $db = $app['arangodb']; |
|
| 262 | ||
| 263 | return new GraphHandler($db); |
|
| 264 | } |
|
| 265 | ); |
|
| 266 | ||
| 267 | $app['arangodbs.graph_handler'] = $app->share( |
|
| 268 | function ($app) { |
|
| 269 | $app['arangodbs.options.initializer'](); |
|
| 270 | ||
| 271 | $handlers = new \Pimple(); |
|
| 272 | foreach ($app['arangodbs.options'] as $name => $options) { |
|
| 273 | $handlers[$name] = new GraphHandler($app['arangodbs'][$name]); |
|
| 274 | } |
|
| 275 | ||
| 276 | return $handlers; |
|
| 277 | } |
|
| 278 | ); |
|
| 279 | } |
|
| 280 | ||
| 281 | protected function statementManagement(Application $app) |
|
| 282 | { |
|