Exemple #1
0
 /**
  * Creates a new TransparentAuthentication
  *
  * @param   array  $config  The configuration values for the TransparentAuthentication object
  *
  * @return  TransparentAuthentication
  */
 public function transparentAuthentication(array $config = array())
 {
     $toolbarClass = $this->container->getNamespacePrefix($this->getSection()) . 'TransparentAuthentication\\TransparentAuthentication';
     try {
         return $this->createTransparentAuthentication($toolbarClass, $config);
     } catch (TransparentAuthenticationNotFound $e) {
         // Not found. Let's go on.
     }
     $toolbarClass = $this->container->getNamespacePrefix('inverse') . 'TransparentAuthentication\\TransparentAuthentication';
     try {
         return $this->createTransparentAuthentication($toolbarClass, $config);
     } catch (TransparentAuthenticationNotFound $e) {
         // Not found. Return the magically created TransparentAuthentication
         $magic = new TransparentAuthenticationFactory($this->container);
         // Let's pass the section override (if any)
         $magic->setSection($this->getSection());
         return $magic->make($config);
     }
 }