本文整理汇总了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;
}
示例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');
}
}
}
示例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");
}
示例4: next
public function next()
{
$this->items->next();
if (!$this->items->valid()) {
$this->page++;
$this->load();
}
}
示例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();
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
}
示例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;
}
示例11: processStatesItr
public function processStatesItr(ArrayIterator $statesItr)
{
// ArrayIterator
for ($statesItr; $statesItr->valid(); $statesItr->next()) {
echo $statesItr->key() . ' : ' . $statesItr->current() . PHP_EOL;
}
}
示例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;
}
示例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;
}
示例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();
}
示例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();
}
}
}