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


PHP ArrayIterator::next方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: next

 public function next()
 {
     $this->items->next();
     if (!$this->items->valid()) {
         $this->page++;
         $this->load();
     }
 }
开发者ID:renanbr,项目名称:crossref-client,代码行数:8,代码来源:Rows.php

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: next

 public function next()
 {
     $this->eventsIterator->next();
     $this->currentKey++;
     if ($this->eventsIterator->valid()) {
         return;
     }
     $this->feedIterator->next();
     if ($this->feedIterator->valid()) {
         $this->eventsIterator = $this->newEventsIterator();
     } else {
         $this->feedIterator = null;
     }
 }
开发者ID:rayrutjes,项目名称:php-geteventstore-client,代码行数:14,代码来源:EventStreamIterator.php

示例10: getById

 public function getById($id)
 {
     $this->conex = DataBase::getInstance();
     $stid = oci_parse($this->conex, "SELECT *\n\t\t\tFROM FISC_CIUDADANO WHERE ID_CIUDADANO=:id");
     if (!$stid) {
         $e = oci_error($this->conex);
         trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
     }
     // Realizar la lógica de la consulta
     oci_bind_by_name($stid, ':id', $id);
     $r = oci_execute($stid);
     if (!$r) {
         $e = oci_error($stid);
         trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
     }
     // Obtener los resultados de la consulta
     $alm = new FiscCiudadano();
     while ($fila = oci_fetch_array($stid, OCI_ASSOC + OCI_RETURN_NULLS)) {
         $it = new ArrayIterator($fila);
         while ($it->valid()) {
             $alm->__SET(strtolower($it->key()), $it->current());
             $it->next();
         }
     }
     //Libera los recursos
     oci_free_statement($stid);
     // Cierra la conexión Oracle
     oci_close($this->conex);
     //retorna el resultado de la consulta
     return $alm;
 }
开发者ID:vanckruz,项目名称:draftReports,代码行数:31,代码来源:class_fisc_ciudadanoDAO.php

示例11: processStatesItr

 public function processStatesItr(ArrayIterator $statesItr)
 {
     // ArrayIterator
     for ($statesItr; $statesItr->valid(); $statesItr->next()) {
         echo $statesItr->key() . ' : ' . $statesItr->current() . PHP_EOL;
     }
 }
开发者ID:jestintab,项目名称:zendphp,代码行数:7,代码来源:typehinting_exm1.php

示例12: queryByIC

 /**
  *
  *@param $id_ciu
  *
  *
  **/
 public function queryByIC($id_ciu)
 {
     $this->conex = DataBase::getInstance();
     $stid = oci_parse($this->conex, "SELECT * FROM TBL_REPRESENTANTEEMPRESAS WHERE CLV_REPRESENTANTE=:id_ciu");
     if (!$stid) {
         $e = oci_error($this->conex);
         trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
     }
     // Realizar la lógica de la consulta
     oci_bind_by_name($stid, ':id_ciu', $id_ciu);
     $r = oci_execute($stid);
     if (!$r) {
         $e = oci_error($stid);
         trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
     }
     $result = new RepresentanteEmpresa();
     // Obtener los resultados de la consulta
     while ($fila = oci_fetch_array($stid, OCI_ASSOC + OCI_RETURN_NULLS)) {
         $it = new ArrayIterator($fila);
         while ($it->valid()) {
             $result->__SET(strtolower($it->key()), $it->current());
             $it->next();
         }
     }
     //Libera los recursos
     oci_free_statement($stid);
     // Cierra la conexión Oracle
     oci_close($this->conex);
     //retorna el resultado de la consulta
     return $result;
 }
开发者ID:vanckruz,项目名称:draftReports,代码行数:37,代码来源:model_representante.php

示例13: ReplaceChunk

 /**
 * Replace portion of the string
 *
 * @deprecated
 *
 * @param integer $index
 * @param string $value
 * @param integer $start
 * @param integer $length
 *
 * @access public
 * @return void
 */
 public function ReplaceChunk($index, $value, $start = 0, $length = null)
 {
     if (null !== $length) {
         $this->length = $length;
     }
     switch (true) {
         case is_string($value):
             $this->temp_string = new \ArrayIterator(str_split($value));
             if (null === $length) {
                 $this->length = strlen($value);
             }
             break;
         case $value instanceof \ArrayIterator:
             $this->temp_string = $value;
             if (null === $length) {
                 $this->length = $value->count();
             }
             break;
         case is_array($value):
             $this->temp_string = new \ArrayIterator($value);
             if (null === $length) {
                 $this->length = count($value);
             }
             break;
         default:
             throw new \Exception('Invalid data type', 101);
     }
     $this->temp_string->seek($start);
     for ($i = $start; $i < $this->length; $i++) {
         $this->offsetSet($index, $this->temp_string->current());
         $index++;
         $this->temp_string->next();
     }
     $this->temp_string = null;
 }
开发者ID:ckir,项目名称:njsagent-rsscollector,代码行数:48,代码来源:StringBuilder.php

示例14: next

 /**
  * Sets the internal pointer on the next element.
  *
  * @return boolean	True, if the map has a next element, false otherwise
  */
 public function next()
 {
     if ($this->initializeIterator()) {
         $this->iterator->next();
     }
     return $this->iterator->valid();
 }
开发者ID:enriquesomolinos,项目名称:Bengine,代码行数:12,代码来源:Map.util.php

示例15: zroneClassLoader

/**
 * 自动加载
 *
 * @param $className
 */
function zroneClassLoader($className)
{
    $path = array(str_replace("\\", "/", dirname(__FILE__) . DIRECTORY_SEPARATOR . "Vendor/"), str_replace("\\", "/", dirname(__FILE__) . DIRECTORY_SEPARATOR . "FrameWork/"), str_replace("\\", "/", dirname(__FILE__) . DIRECTORY_SEPARATOR . "Application/"));
    if (isset($path) && is_array($path)) {
        $Iterator = new ArrayIterator($path);
        $Iterator->rewind();
        $pathString = "";
        while ($Iterator->valid()) {
            $pathString .= $Iterator->current() . ";";
            if ($Iterator->key() == count($path) - 1) {
                $pathString = rtrim($pathString, ";");
            }
            $Iterator->next();
        }
        set_include_path($pathString);
        spl_autoload_extensions(".php, .class.php");
        spl_autoload($className);
    } else {
        try {
            throw new Exception("<code style='color: red; font-size: 22px; display: block; text-align: center; height: 40px; line-height: 40px;'>I'm sorry, my dear! The FrameWork is Wrong……😫</code>");
        } catch (Exception $e) {
            echo $e->getMessage();
        }
    }
}
开发者ID:zrone,项目名称:apiDocument,代码行数:30,代码来源:zroneFrameWork.php


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