Symfony\Component\DependencyInjection\Reference::getInvalidBehavior PHP Method

getInvalidBehavior() public method

Returns the behavior to be used when the service does not exist.
public getInvalidBehavior ( ) : integer
return integer
    public function getInvalidBehavior()
    {
        return $this->invalidBehavior;
    }

Usage Example

Exemplo n.º 1
0
 protected function getServiceCall($id, Reference $reference = null)
 {
     if ('service_container' === $id) {
         return '$this';
     }
     if (null !== $reference && ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $reference->getInvalidBehavior()) {
         return sprintf('$this->get(\'%s\', ContainerInterface::NULL_ON_INVALID_REFERENCE)', $id);
     } else {
         if ($this->container->hasAlias($id)) {
             $id = $this->container->getAlias($id);
         }
         return sprintf('$this->get(\'%s\')', $id);
     }
 }
All Usage Examples Of Symfony\Component\DependencyInjection\Reference::getInvalidBehavior