private function defineEntityAdapter(Request $request)
 {
     $adapterMapper = array();
     $instanciableDependencyInterfaceAliases = $request->getInstanciableDependencyInterfaceAliases();
     foreach ($instanciableDependencyInterfaceAliases as $oneInterfaceAlias) {
         $interfaceName = $oneInterfaceAlias->getInterfaceName();
         $className = $oneInterfaceAlias->getClassName();
         $adapterMapper[$interfaceName] = $this->getInjector()->make($className);
     }
     $objectMapper = array();
     $interfaceAlias = $request->getObjectInterfaceAliases();
     foreach ($interfaceAlias as $oneInterfaceAlias) {
         $interfaceName = $oneInterfaceAlias->getInterfaceName();
         $className = $oneInterfaceAlias->getClassName();
         $objectMapper[$interfaceName] = $className;
     }
     $containerMaps = $request->getContainerMaps();
     $mapper = array();
     foreach ($containerMaps as $oneContainerMap) {
         $containerName = $oneContainerMap->getContainer();
         $className = $oneContainerMap->getClassName();
         $mapper[$containerName] = $className;
     }
     //Entity Adapter:
     $this->getInjector()->define('iRESTful\\EntityAPIs\\Infrastructure\\Adapters\\ConcreteEntityAdapter', [':adapterMapper' => $adapterMapper, ':interfaceClassMapper' => $objectMapper, ':containerClassMapper' => $mapper]);
 }
Пример #2
0
 private function defineDateTimeZone(Request $request)
 {
     $timeZone = $request->getTimeZone();
     //Configure TimeZone:
     $this->define('iRESTful\\Dates\\Infrastructure\\Adapters\\ConcreteDateTimeAdapter', [':timeZone' => $timeZone]);
 }