Ejemplo n.º 1
0
 /**
  * Gets the service call.
  *
  * @param string    $id
  * @param ehough_iconic_Reference $reference
  *
  * @return string
  */
 private function getServiceCall($id, ehough_iconic_Reference $reference = null)
 {
     if (null !== $reference && ehough_iconic_ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $reference->getInvalidBehavior()) {
         return sprintf('@?%s', $id);
     }
     return sprintf('@%s', $id);
 }
Ejemplo n.º 2
0
 /**
  * Gets a service call
  *
  * @param string    $id
  * @param ehough_iconic_Reference $reference
  *
  * @return string
  */
 private function getServiceCall($id, ehough_iconic_Reference $reference = null)
 {
     if ('service_container' === $id) {
         return '$this';
     }
     if (null !== $reference && ehough_iconic_ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $reference->getInvalidBehavior()) {
         return sprintf('$this->get(\'%s\', ehough_iconic_ContainerInterface::NULL_ON_INVALID_REFERENCE)', $id);
     } else {
         if ($this->container->hasAlias($id)) {
             $id = (string) $this->container->getAlias($id);
         }
         return sprintf('$this->get(\'%s\')', $id);
     }
 }