當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。