get() 공개 메소드

public get ( string $id ) : mixed
$id string
리턴 mixed
예제 #1
0
 /**
  * @param ServiceLocator $serviceLocator
  * @throws ServiceNotFoundException
  */
 public function boot(ServiceLocator $serviceLocator)
 {
     if (!$serviceLocator->has(Services::KERNEL_TRANSACTION_FACTORY)) {
         throw new ServiceNotFoundException(sprintf('Service with id "%s" is missing in service locator.', Services::KERNEL_TRANSACTION_FACTORY));
     }
     $serviceLocator->get(Services::KERNEL_COMMAND_EXTENSION_REGISTRY)->register(new TransactionExtension($serviceLocator->get(Services::KERNEL_TRANSACTION_FACTORY)), -1024);
 }
예제 #2
0
 /**
  * @param ServiceLocator $serviceLocator
  */
 protected function registerCommandExtensions(ServiceLocator $serviceLocator)
 {
     $serviceLocator->get(Services::KERNEL_COMMAND_EXTENSION_REGISTRY)->register(new MetadataExtension());
 }
예제 #3
0
 /**
  * @param Command $command
  * @param ServiceLocator $serviceLocator
  */
 public function post(Command $command, ServiceLocator $serviceLocator)
 {
     /* @var CreateProduct $command */
     $serviceLocator->get(Services::KERNEL_METADATA_ACCESS_REGISTRY)->getMAO(InventoryMetadata::TYPE_NAME)->save(new Metadata(MetadataId::generate(), InventoryMetadata::TYPE_NAME, [InventoryMetadata::FIELD_SKU => $command->sku(), InventoryMetadata::FIELD_VISIBLE => false]));
 }
예제 #4
0
 /**
  * @param ServiceLocator $serviceLocator
  */
 protected function mapCommands(ServiceLocator $serviceLocator)
 {
     $serviceLocator->get(Services::KERNEL_COMMAND_HANDLER_MAP)->register(CreateCart::class, $serviceLocator->get(CustomerServices::CUSTOMER_CREATE_CART_HANDLER));
     $serviceLocator->get(Services::KERNEL_COMMAND_HANDLER_MAP)->register(AddToCart::class, $serviceLocator->get(CustomerServices::CUSTOMER_ADD_TO_CART_HANDLER));
     $serviceLocator->get(Services::KERNEL_COMMAND_HANDLER_MAP)->register(RemoveFromCart::class, $serviceLocator->get(CustomerServices::CUSTOMER_REMOVE_FROM_CART_HANDLER));
 }