当前位置: 首页>>代码示例>>PHP>>正文


PHP Foo::setBar方法代码示例

本文整理汇总了PHP中Foo::setBar方法的典型用法代码示例。如果您正苦于以下问题:PHP Foo::setBar方法的具体用法?PHP Foo::setBar怎么用?PHP Foo::setBar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Foo的用法示例。


在下文中一共展示了Foo::setBar方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

 /**
  * Returns a collection of Foo instances according to
  * the configuration section.
  */
 public function &process(__ConfigurationSection &$section)
 {
     $return_value = array();
     $foobars = $section->getSections();
     foreach ($foobars as &$foobar) {
         $foo = new Foo();
         $foo->setBar($foobar->getAttribute('bar'));
         $return_value[] = $foo;
     }
     return $return_value;
 }
开发者ID:laiello,项目名称:lion-framework,代码行数:15,代码来源:SectionHandler.class.php

示例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()
 {
     $this->services['foo_with_inline'] = $instance = new \Foo();
     $instance->setBar($this->get('inlined'));
     return $instance;
 }
开发者ID:vomasmic,项目名称:symfony,代码行数:14,代码来源:services9.php

示例3: 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;
 }
开发者ID:xing393939,项目名称:Laravel-5-Bootstrap-3-Starter-Site,代码行数:17,代码来源:services9_compiled.php

示例4: 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()
 {
     $this->services['foo_with_inline'] = $instance = new \Foo();
     $instance->setBar(${($_ = isset($this->services['inlined']) ? $this->services['inlined'] : $this->getInlinedService()) && false ?: '_'});
     return $instance;
 }
开发者ID:Gladhon,项目名称:symfony,代码行数:14,代码来源:services9.php

示例5: Foo

<?php

require_once 'pb_proto_foo.php';
$foo = new Foo();
$foo->setBar(1);
$foo->setBaz('two');
$foo->appendSpam(3.0);
$foo->appendSpam(4.0);
$packed = $foo->serializeToString();
$foo->reset();
try {
    $foo->parseFromString($packed);
} catch (Exception $ex) {
    die('Upss.. there is a bug in this example');
}
$foo->dump();
开发者ID:fabiand93,项目名称:php-protobuf,代码行数:16,代码来源:example.php


注:本文中的Foo::setBar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。