コード例 #1
0
ファイル: Pool.php プロジェクト: kinkinweb/lhvb
 /**
  * add a payment method into the pool.
  *
  * @param PaymentInterface $instance
  *
  * @throws \RuntimeException
  */
 public function addMethod(PaymentInterface $instance)
 {
     if (null === $instance->getCode()) {
         throw new \RuntimeException(sprintf('Payment handler of class %s must return a code on getCode method. Please refer to the documentation (https://sonata-project.org/bundles/ecommerce/master/doc/reference/bundles/payment/index.html)', get_class($instance)));
     }
     $this->methods[$instance->getCode()] = $instance;
 }
コード例 #2
0
ファイル: Pool.php プロジェクト: Dicoding/ecommerce
 /**
  * add a payment method into the pool
  *
  * @param PaymentInterface $instance
  */
 public function addMethod(PaymentInterface $instance)
 {
     $this->methods[$instance->getCode()] = $instance;
 }