當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PriorityQueue::toArray方法代碼示例

本文整理匯總了PHP中Zend\Stdlib\PriorityQueue::toArray方法的典型用法代碼示例。如果您正苦於以下問題:PHP PriorityQueue::toArray方法的具體用法?PHP PriorityQueue::toArray怎麽用?PHP PriorityQueue::toArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend\Stdlib\PriorityQueue的用法示例。


在下文中一共展示了PriorityQueue::toArray方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: unregister

 /**
  * {@inheritdoc}
  */
 public function unregister($service)
 {
     if (!$this->has($service)) {
         throw new NonExistingServiceException($this->context, gettype($service), array_keys($this->services->toArray()));
     }
     $this->services->remove($service);
 }
開發者ID:ReissClothing,項目名稱:Sylius,代碼行數:10,代碼來源:PrioritizedServiceRegistry.php

示例2: __clone

    /**
     * Make a deep clone of a fieldset
     *
     * @return void
     */
    public function __clone()
    {
        $items = $this->iterator->toArray(PriorityQueue::EXTR_BOTH);

        $this->byName    = array();
        $this->elements  = array();
        $this->fieldsets = array();
        $this->iterator  = new PriorityQueue();

        foreach ($items as $item) {
            $elementOrFieldset = clone $item['data'];
            $name = $elementOrFieldset->getName();

            $this->iterator->insert($elementOrFieldset, $item['priority']);
            $this->byName[$name] = $elementOrFieldset;

            if ($elementOrFieldset instanceof FieldsetInterface) {
                $this->fieldsets[$name] = $elementOrFieldset;
            } elseif ($elementOrFieldset instanceof ElementInterface) {
                $this->elements[$name] = $elementOrFieldset;
            }
        }

        // Also make a deep copy of the object in case it's used within a collection
        if (is_object($this->object)) {
            $this->object = clone $this->object;
        }
    }
開發者ID:Robert-Xie,項目名稱:php-framework-benchmark,代碼行數:33,代碼來源:Fieldset.php

示例3: testCanCastToArrayOfDataPriorityPairs

 public function testCanCastToArrayOfDataPriorityPairs()
 {
     $expected = array(
         array('data' => 'foo', 'priority' => 3),
         array('data' => 'bar', 'priority' => 4),
         array('data' => 'baz', 'priority' => 2),
         array('data' => 'bat', 'priority' => 1),
     );
     $test     = $this->queue->toArray(PriorityQueue::EXTR_BOTH);
     $this->assertSame($expected, $test, var_export($test, 1));
 }
開發者ID:benivaldo,項目名稱:zf2-na-pratica,代碼行數:11,代碼來源:PriorityQueueTest.php

示例4: getValidators

 /**
  * Get all the validators
  *
  * @return array
  */
 public function getValidators()
 {
     return $this->validators->toArray(PriorityQueue::EXTR_DATA);
 }
開發者ID:MadCat34,項目名稱:zend-validator,代碼行數:9,代碼來源:ValidatorChain.php


注:本文中的Zend\Stdlib\PriorityQueue::toArray方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。