本文整理汇总了PHP中Bar::setBaz方法的典型用法代码示例。如果您正苦于以下问题:PHP Bar::setBaz方法的具体用法?PHP Bar::setBaz怎么用?PHP Bar::setBaz使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bar
的用法示例。
在下文中一共展示了Bar::setBaz方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInlinedService
/**
* Gets the 'inlined' service.
*
* This service is shared.
* This method always returns the same instance of the service.
*
* This service is private.
* If you want to be able to request this service from the container directly,
* make it public, otherwise you might end up with broken code.
*
* @return \Bar A Bar instance.
*/
protected function getInlinedService()
{
$this->services['inlined'] = $instance = new \Bar();
$instance->setBaz($this->get('baz'));
$instance->pub = 'pub';
return $instance;
}
示例2: getFooWithInlineService
/**
* Gets the 'foo_with_inline' service.
*
* This service is shared.
* This method always returns the same instance of the service.
*
* @return \Foo A Foo instance
*/
protected function getFooWithInlineService()
{
$a = new \Bar();
$this->services['foo_with_inline'] = $instance = new \Foo();
$a->setBaz($this->get('baz'));
$a->pub = 'pub';
$instance->setBar($a);
return $instance;
}