protected function getServiceCall($id, Reference $reference = null) { if (null !== $reference && Container::EXCEPTION_ON_INVALID_REFERENCE !== $reference->getInvalidBehavior()) { return sprintf('@@%s', $id); } else { return sprintf('@%s', $id); } }
protected function getXmlInvalidBehavior(Reference $reference) { switch ($reference->getInvalidBehavior()) { case Container::NULL_ON_INVALID_REFERENCE: return 'on-invalid="null" '; case Container::IGNORE_ON_INVALID_REFERENCE: return 'on-invalid="ignore" '; default: return ''; } }
protected function getServiceCall($id, Reference $reference = null) { if ('service_container' === $id) { return '$this'; } if (null !== $reference && Container::EXCEPTION_ON_INVALID_REFERENCE !== $reference->getInvalidBehavior()) { return sprintf('$this->getService(\'%s\', Container::NULL_ON_INVALID_REFERENCE)', $id); } else { if ($this->container->hasAlias($id)) { $id = $this->container->getAlias($id); } if ($this->container->hasDefinition($id)) { return sprintf('$this->get%sService()', Container::camelize($id)); } return sprintf('$this->getService(\'%s\')', $id); } }
protected function getServiceCall($id, Reference $reference = null) { if ('service_container' == $id) { return '$this'; } if (null !== $reference && Container::EXCEPTION_ON_INVALID_REFERENCE !== $reference->getInvalidBehavior()) { return sprintf('$this->getService(\'%s\', Container::NULL_ON_INVALID_REFERENCE)', $id); } else { return sprintf('$this->getService(\'%s\')', $id); } }