当前位置: 首页>>代码示例>>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;未经允许,请勿转载。