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


PHP ArrayIterator::current方法代码示例

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


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

示例1: search

 /**
  *
  * @param <type> $table
  * @param ArrayIterator $params
  * @return ArrayObject
  */
 public function search($table, ArrayIterator $params)
 {
     $this->searchParams = $params;
     $this->join();
     if ($table == "analysis") {
         $this->statements->remove("type_event");
     }
     $statement = "SELECT this_.* " . $this->selectAttributes() . " FROM {$table} this_ ";
     $statement .= $this->join();
     $i = 0;
     $this->searchParams->rewind();
     if ($this->searchParams->count() > 0 && !$this->searchParams->offsetExists('true')) {
         $statement .= " WHERE ";
     }
     while ($this->searchParams->valid()) {
         if ($this->statements->containsKey($this->searchParams->key())) {
             if ($i++ > 0) {
                 $statement .= " AND ";
             }
             $clause = $this->statements->get($this->searchParams->key());
             $statement .= str_replace(":" . $this->searchParams->key(), "'" . $this->searchParams->current() . "'", $clause['where']);
         }
         $this->searchParams->next();
     }
     return $this->getObject($statement . " ORDER BY this_.date DESC, this_.id DESC");
 }
开发者ID:raigons,项目名称:bureauinteligencia,代码行数:32,代码来源:SearchEngine.php

示例2: leaf

 static function create_tree(ArrayIterator &$it)
 {
     if (!in_array($it->current()["term"], self::operators_dictionary)) {
         $leaf = new leaf($it->current());
         $it->next();
         return $leaf;
     } else {
         if ($it->current()["term"] == "not") {
             $it->next();
             $op = self::create_tree($it);
             return new notEx($op);
         } else {
             if ($it->current()["term"] == "and") {
                 $it->next();
                 $left = self::create_tree($it);
                 $right = self::create_tree($it);
                 return new andEx($left, $right);
             } else {
                 if ($it->current()["term"] == "or") {
                     $it->next();
                     $left = self::create_tree($it);
                     $right = self::create_tree($it);
                     return new orEx($left, $right);
                 }
             }
         }
     }
     return null;
 }
开发者ID:rotman,项目名称:searchEngine,代码行数:29,代码来源:parser.class.php

示例3: onResponse

 /**
  * Switches to alternate nicks as needed when nick collisions occur.
  *
  * @return void
  */
 public function onResponse()
 {
     // If no alternate nick list was found, return
     if (empty($this->iterator)) {
         return;
     }
     // If the response event indicates that the nick set is in use...
     $code = $this->getEvent()->getCode();
     if ($code == Phergie_Event_Response::ERR_NICKNAMEINUSE) {
         // Attempt to move to the next nick in the alternate nick list
         $this->iterator->next();
         // If another nick is available...
         if ($this->iterator->valid()) {
             // Switch to the new nick
             $altNick = $this->iterator->current();
             $this->doNick($altNick);
             // Update the connection to reflect the nick change
             $this->getConnection()->setNick($altNick);
         } else {
             // If no other nicks are available...
             // Terminate the connection
             $this->doQuit('All specified alternate nicks are in use');
         }
     }
 }
开发者ID:phergie,项目名称:phergie,代码行数:30,代码来源:AltNick.php

示例4: key

 /**
  * @return NormalizedProduction|null
  */
 public function key()
 {
     if ($this->innerIterator->valid()) {
         /** @var LookAheadSetEntry $entry */
         $entry = $this->innerIterator->current();
         return $entry->getKey();
     }
     return null;
 }
开发者ID:helstern,项目名称:nomsky-lib,代码行数:12,代码来源:LookAheadSetEntryIterator.php

示例5: current

 /**
  * {@inheritdoc}
  */
 public function current()
 {
     $current = $this->iterator->current();
     $data = array();
     foreach ($this->propertyPaths as $name => $propertyPath) {
         $data[$name] = $this->getValue($this->propertyAccessor->getValue($current, $propertyPath));
     }
     return $data;
 }
开发者ID:LamaDelRay,项目名称:test_symf,代码行数:12,代码来源:PropelCollectionSourceIterator.php

示例6: dayInfo

 private function dayInfo()
 {
     $this->daysInfo = new ArrayIterator();
     while ($this->days->valid()) {
         $day = explode(") - ", $this->days->current());
         $infos = explode("/", $day[1]);
         $this->daysInfo->append($this->buildWeatherDayInfo($day[0], $infos));
         $this->days->next();
     }
 }
开发者ID:raigons,项目名称:bureauinteligencia,代码行数:10,代码来源:WeatherForecast.php

示例7: current

 /**
  * get current testable object from collection
  *
  * @return \PhpUnitTestGenerator\Testable\Object
  */
 public function current()
 {
     $f = $this->fileList->current();
     if (is_file($f)) {
         $object = Builder::buildTestableObjectFromFile($f);
         /* @var $object \PhpUnitTestGenerator\Testable\Object */
         return $object;
     }
     return null;
 }
开发者ID:basuritas-php,项目名称:phpunitgenerator,代码行数:15,代码来源:Collection.php

示例8: read

 /**
  * {@inheritdoc}
  */
 public function read()
 {
     if (!$this->isExecuted) {
         $this->isExecuted = true;
         $this->results = $this->getResults();
     }
     if (null !== ($result = $this->results->current())) {
         $this->results->next();
         $this->stepExecution->incrementSummaryInfo('read');
     }
     return $result;
 }
开发者ID:abdeldayem,项目名称:pim-community-dev,代码行数:15,代码来源:BaseReader.php

示例9: read

 /**
  * {@inheritdoc}
  */
 public function read()
 {
     if (null === $this->results) {
         $items = $this->readItems();
         $this->results = new \ArrayIterator($items);
     }
     if (null !== ($result = $this->results->current())) {
         $this->results->next();
         $this->stepExecution->incrementSummaryInfo('read');
     }
     return $result;
 }
开发者ID:abdeldayem,项目名称:pim-community-dev,代码行数:15,代码来源:AbstractReader.php

示例10: buildMany

 /**
  * @param $fixtureType
  * @param FixtureBuilder $builder
  * @param array $entities
  * @param string $hook
  * @return array
  * @throws UndefinedFixtureModel
  */
 public static function buildMany($fixtureType, FixtureBuilder $builder, array $entities, $hook = '')
 {
     $many = [];
     $iterator = new \ArrayIterator($entities);
     while ($iterator->valid()) {
         $builder->throwUndefinedDataProvider($iterator->current());
         $fixtureId = self::_buildAndRegisterFixture($fixtureType, $hook, $iterator->current());
         $many[] = self::_getMagentoModel($iterator->current(), $fixtureId);
         $iterator->next();
     }
     return $many;
 }
开发者ID:ctasca,项目名称:magefix,代码行数:20,代码来源:Builder.php

示例11: proceed

 /**
  * {@inheritDoc}
  */
 public function proceed(CommandMessageInterface $commandProceedWith = null)
 {
     if (null !== $commandProceedWith) {
         $this->command = $commandProceedWith;
     }
     if ($this->chain->valid()) {
         $next = $this->chain->current();
         $this->chain->next();
         return $next->handle($this->command, $this->unitOfWork, $this);
     } else {
         return $this->handler->handle($this->command, $this->unitOfWork);
     }
 }
开发者ID:fcm,项目名称:GovernorFramework,代码行数:16,代码来源:DefaultInterceptorChain.php

示例12: getValuesFromData

 private function getValuesFromData(ArrayIterator $dataValues)
 {
     $values = array();
     while ($dataValues->valid()) {
         if ($dataValues->current() instanceof Data) {
             array_push($values, $dataValues->current()->getValue());
         }
         $dataValues->next();
     }
     if (sizeof($values) > 0) {
         return new ArrayIterator($values);
     }
     return $dataValues;
 }
开发者ID:raigons,项目名称:bureauinteligencia,代码行数:14,代码来源:StatisticsTest.php

示例13: testSeek

 function testSeek()
 {
     $iterator = new ArrayIterator([0, 5, 2, 6]);
     $iterator->rewind();
     $iterator->seek(3);
     $this->assertEquals(6, $iterator->current());
     $iterator->seek(1);
     $this->assertEquals(5, $iterator->current());
     $iterator->seek(2);
     $this->assertEquals(2, $iterator->current());
     $iterator->seek(0);
     $this->assertEquals(0, $iterator->current());
     $iterator->seek(3);
     $this->assertEquals(6, $iterator->current());
 }
开发者ID:pramoddas,项目名称:Ardent,代码行数:15,代码来源:ArrayIteratorTest.php

示例14: buildLinesHtml

 public static function buildLinesHtml(ArrayIterator $cot, $anotherType = null)
 {
     $html = "";
     while ($cot->valid()) {
         $html .= "<tr id='" . $cot->current()->getCode() . "' class='cotation-values'>";
         if ($anotherType == null) {
             $html .= self::buildLineWithCurrent($cot->current());
         } else {
             $html .= self::buildLineWithCurrentFisicaOrIndicador($cot->current(), $anotherType);
         }
         $html .= "</tr>";
         $cot->next();
     }
     return $html;
 }
开发者ID:raigons,项目名称:bureauinteligencia,代码行数:15,代码来源:HtmlLib.php

示例15: current

 /**
  * Return the current resource.
  *
  * @return \com\mohiva\common\io\Resource The current `Resource` object or null if no resource
  * exists.
  */
 public function current()
 {
     if (!$this->valid()) {
         return null;
     }
     return $this->iterator->current();
 }
开发者ID:mohiva,项目名称:common,代码行数:13,代码来源:TempResourceContainer.php


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