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


PHP Container::toArray方法代码示例

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


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

示例1: testApply

 public function testApply()
 {
     $config = ["level1" => ["level2" => ["level3" => "123"], "level2-1" => ["level3-1" => "321"]]];
     $object = new Container($config);
     $this->assertEquals("123", $object->level1["level2"]->level3);
     $reverse = function ($v) {
         return strrev($v);
     };
     $object->apply(["level1" => ["level2" => ["level3" => $reverse], "level2-1" => ["level3-1" => $reverse]]]);
     $compare = ["level1" => ["level2" => ["level3" => "321"], "level2-1" => ["level3-1" => "123"]]];
     $this->assertEquals($compare, $object->toArray());
     $object->apply(function () {
         return null;
     });
     $this->assertEquals(["level1" => null], $object->toArray());
 }
开发者ID:m6w6,项目名称:merry,代码行数:16,代码来源:ContainerTest.php

示例2: toArray

 /**
  * @return array
  */
 public function toArray()
 {
     $tmp = new Container(null, []);
     foreach ($this->changesTracker as $itemKey => $opType) {
         if ($opType == ITEM_OPERATION_ADD || $opType == ITEM_OPERATION_NEW_VALUE) {
             $tmp->set($this->get($itemKey));
         }
     }
     return $tmp->toArray();
 }
开发者ID:phpcrystal,项目名称:phpcrystal,代码行数:13,代码来源:FlashContainer.php

示例3: toArray

 /**
  * Returns an array representation of the page
  *
  * @return array  associative array containing all page properties
  */
 public function toArray()
 {
     return array_merge($this->getCustomProperties(), array('label' => $this->getlabel(), 'fragment' => $this->getFragment(), 'id' => $this->getId(), 'class' => $this->getClass(), 'title' => $this->getTitle(), 'target' => $this->getTarget(), 'accesskey' => $this->getAccesskey(), 'rel' => $this->getRel(), 'rev' => $this->getRev(), 'customHtmlAttribs' => $this->getCustomHtmlAttribs(), 'order' => $this->getOrder(), 'resource' => $this->getResource(), 'privilege' => $this->getPrivilege(), 'active' => $this->isActive(), 'visible' => $this->isVisible(), 'type' => get_class($this), 'pages' => parent::toArray()));
 }
开发者ID:schpill,项目名称:thin,代码行数:9,代码来源:Page.php

示例4: save

 public function save(Container $row)
 {
     $id = isAke($row->toArray(), 'id', null);
     return is_null($id) ? $this->add($row) : $this->insertRow($this->toArray($row));
 }
开发者ID:schpill,项目名称:thin,代码行数:5,代码来源:Nosql.php

示例5: toArray

 /**
  * {@inheritdoc}
  */
 public function toArray()
 {
     $this->fillSpan();
     return parent::toArray();
 }
开发者ID:guratr,项目名称:cruddy,代码行数:8,代码来源:Row.php

示例6: mergeBlueObject

 /**
  * allow to join two blue objects into one
  *
  * @param \BlueContainer\Container $object
  * @return $this
  */
 public function mergeBlueObject(Container $object)
 {
     $newData = $object->toArray();
     foreach ($newData as $key => $value) {
         $this->appendData($key, $value);
     }
     $this->_dataChanged = true;
     return $this;
 }
开发者ID:bluetree-service,项目名称:container,代码行数:15,代码来源:ContainerObject.php


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