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


PHP ArrayObject::getIterator方法代码示例

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


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

示例1: getIterator

 public function getIterator()
 {
     if ($this->cacheIsFilled !== TRUE) {
         $this->fillCache();
     }
     return $this->instanceCache->getIterator();
 }
开发者ID:SystemEd-Jacob,项目名称:nethgui,代码行数:7,代码来源:ModuleLoader.php

示例2: clear

 /**
  * Clear the Collection
  *
  * <ul>
  *
  *     <li>Empties Collection Storage and References Storage</li>
  *     <li>Redefine Collection Iterator</li>
  *
  * </ul>
  *
  * @return Next\Components\Iterator\AbstractCollection
  *   Collection Object (Fluent Interface)
  */
 public function clear()
 {
     $this->collection = new \ArrayObject();
     $this->references = new \ArrayObject();
     $this->iterator = $this->collection->getIterator();
     return $this;
 }
开发者ID:nextframework,项目名称:next,代码行数:20,代码来源:AbstractCollection.php

示例3: unEscapeParameters

 public function unEscapeParameters($string)
 {
     if (!$this->parametersArray) {
         throw new \Exception('You try unescape string that not be escaped');
     }
     $this->iterator = $this->parametersArray->getIterator();
     return preg_replace_callback("|NotTranslatedString|", array($this, 'unEscapeParametersCallback'), $string);
 }
开发者ID:ja1cap,项目名称:GoogleTranslateBundle,代码行数:8,代码来源:ParametersEscaper.php

示例4: __construct

 /**
  * Constructor
  *
  * @param int   $total Total @ of results w/o pagination bounds
  * @param array $items An array of Resqee_Persistence_Item items
  */
 public function __construct(Resqee_Persistence_SearchParams $params, $total = 0, array $items = array())
 {
     $this->total = $total;
     $this->limit = $params->limit;
     $this->items = new ArrayObject($items);
     $this->iter = $this->items->getIterator();
     $this->numPages = (int) ceil($total / $params->limit);
     $this->currentPage = (int) floor($params->offset / $params->limit) + 1;
     $this->lastIndex = $this->count() > 0;
 }
开发者ID:phatduckk,项目名称:resqee,代码行数:16,代码来源:SearchResults.php

示例5: __construct

 /**
  * Constructor
  * 
  * @param $state
  * @param $template
  * @return void
  */
 public function __construct($state, $template = null)
 {
     // When omitting, set the same name.
     if (!$template) {
         $template = $state;
     }
     $this->state = $state;
     $this->template = $template;
     $this->eventMap = new ArrayObject(array());
     $this->eventMapIterator = $this->eventMap->getIterator();
 }
开发者ID:shin1rosei,项目名称:sfFlowPlugin,代码行数:18,代码来源:State.class.php

示例6: __construct

 /**
  * Constructs the TextIterator
  *
  * @param string $subject
  * @param integer $iteratorType The type of iterator
  * @throws \TYPO3\FLOW3\Error\Exception
  */
 public function __construct($subject, $iteratorType = self::CHARACTER)
 {
     if ($iteratorType < 1 || $iteratorType > 6) {
         throw new \TYPO3\FLOW3\Error\Exception('Fatal error: Invalid iterator type in TextIterator constructor', 1210849014);
     }
     $this->iteratorType = $iteratorType;
     $this->subject = (string) $subject;
     $this->currentPosition = 0;
     $this->iteratorCache = new \ArrayObject();
     $this->iteratorCacheIterator = $this->iteratorCache->getIterator();
     $this->generateIteratorElements();
     $this->iteratorCacheIterator->rewind();
     $this->previousElement = $this->iteratorCacheIterator->current();
 }
开发者ID:nxpthx,项目名称:FLOW3,代码行数:21,代码来源:TextIterator.php

示例7: removePlayer

 /**
  * Deletes player
  * @param $id
  */
 public function removePlayer($id)
 {
     $x = 0;
     $i = $this->players->getIterator();
     while ($i->valid()) {
         if ($i->current()->getID() == $id) {
             $i->offsetUnset($x);
         }
         $i->next();
         $x++;
     }
     $i->rewind();
     $this->iterator = $i;
 }
开发者ID:delboy1978uk,项目名称:casino,代码行数:18,代码来源:Table.php

示例8: zipcodesUniqueValues

 /**
  * Lee el archivo de codigos postales y crea un nuevo vector con valores unicos.
  * @throws Exception
  */
 public function zipcodesUniqueValues()
 {
     $code = new ArrayObject();
     $data = \helper\GeoHelper::readZipcodeFile($this->sources['path']['txt']['zipcode']);
     $zip = $data->getIterator();
     while ($zip->valid()) {
         $content = $zip->current();
         $code->append("{$content->offsetGet(0)}||");
         $zip->next();
     }
     $this->zipcodesBlocks = new ArrayObject(array_unique($code->getArrayCopy()));
     $iterator = $this->zipcodesBlocks->getIterator();
     $dir = __DIR__ . '/test';
     mkdir($dir, 0777);
     $file = bin2hex(openssl_random_pseudo_bytes(10));
     $file = "{$dir}/zipcode_location_{$file}.txt";
     $handle = fopen($file, 'w');
     echo "[32m Creando el archivo {$file}\n";
     while ($iterator->valid()) {
         fwrite($handle, "{$iterator->current()}\n");
         $iterator->next();
     }
     fclose($handle);
     echo "[33m Se ha terminado de crear el archivo.\n";
 }
开发者ID:uetiko,项目名称:SDInvoicesFileCheck,代码行数:29,代码来源:Zipcode.php

示例9: sentenceWrapper

 private function sentenceWrapper(SentenceUtil $sentence)
 {
     $it = $sentence->getBuildCommand()->getIterator();
     $attr = null;
     $main = new \ArrayObject();
     $append = new \ArrayObject();
     while ($it->valid()) {
         if (Util::contains($it->current()->getClause(), "commandPrint") || Util::contains($it->current()->getClause(), "commandReguler")) {
             if ($attr == null) {
                 $main->append($it->current());
             }
         } else {
             //if contains neither then add to append commands
             $append->append($it->current());
         }
         $it->next();
     }
     foreach ($append->getIterator() as $a) {
         $main->append($a);
     }
     /*
     
             $it->rewind();
     
             while ($it->valid()) {
                 if (!Util::contains($it->current()->getClause(), "commandPrint") &&
                     !Util::contains($it->current()->getClause(), "commandReguler")) {
                 }
                 $it->next();
             }
     */
     return $main;
 }
开发者ID:xwiz,项目名称:mikrotik-api,代码行数:33,代码来源:TalkerSender.php

示例10: getIterator

 public function getIterator()
 {
     if (!isset($this->iterator)) {
         $this->iterator = parent::getIterator();
     }
     return $this->iterator;
 }
开发者ID:robchett,项目名称:framework,代码行数:7,代码来源:collection.php

示例11: getIterator

 public function getIterator()
 {
     if (!isset($this->data)) {
         $this->lazyInitialization();
     }
     return $this->data->getIterator();
 }
开发者ID:SystemEd-Jacob,项目名称:nethgui,代码行数:7,代码来源:TableAdapter.php

示例12: add

 /**
  * array object değeri add edilir
  * 
  * @param \ArrayObject $ArrayObject
  * @param string $key
  * @param string $name
  * @return void
  */
 public function add(\ArrayObject $ArrayObject, $key = null, $name = null)
 {
     $iterator = $ArrayObject->getIterator();
     $this->num_rows = $iterator->count();
     if ($key == null && $name == null) {
         while ($iterator->valid()) {
             $arr = $iterator->current();
             $this->dataArr[] = ['id' => $arr, 'name' => $arr];
             $iterator->next();
             $this->error = false;
         }
     } else {
         $sonaEklenecek = array();
         while ($iterator->valid()) {
             $arr = $iterator->current();
             if ($this->getEnSonaEklenecekDeger() == null) {
                 $this->dataArr[] = ['id' => $arr[$key], 'name' => trim($arr[$name])];
             } else {
                 $value = trim($arr[$name]);
                 if ($this->getEnSonaEklenecekDeger() == $value) {
                     $sonaEklenecek = ['id' => $arr[$key], 'name' => $value];
                 } else {
                     $this->dataArr[] = ['id' => $arr[$key], 'name' => $value];
                 }
             }
             $iterator->next();
             $this->error = false;
         }
         if (count($sonaEklenecek) != 0) {
             $this->dataArr[] = $sonaEklenecek;
         }
     }
 }
开发者ID:QRMarket,项目名称:PHP,代码行数:41,代码来源:DataListener.class.php

示例13: getInputHtml

 public function getInputHtml($name, $value)
 {
     // Get site templates path
     $templatesPath = $siteTemplatesPath = craft()->path->getSiteTemplatesPath();
     // Check if the templates path is overriden by configuration
     // TODO: Normalize path
     $limitToSubfolder = craft()->config->get('templateselectSubfolder');
     if ($limitToSubfolder) {
         $templatesPath = $templatesPath . rtrim($limitToSubfolder, '/') . '/';
     }
     // Check if folder exists, or give error
     if (!IOHelper::folderExists($templatesPath)) {
         throw new \InvalidArgumentException('(Template Select) Folder doesn\'t exist: ' . $templatesPath);
     }
     // Get folder contents
     $templates = IOHelper::getFolderContents($templatesPath, TRUE);
     // Add placeholder for when there is no template selected
     $filteredTemplates = array('' => Craft::t('No template selected'));
     // Turn array into ArrayObject
     $templates = new \ArrayObject($templates);
     // Iterate over template list
     // * Remove full path
     // * Remove folders from list
     for ($list = $templates->getIterator(); $list->valid(); $list->next()) {
         $filename = $list->current();
         $filename = str_replace($templatesPath, '', $filename);
         $filenameIncludingSubfolder = $limitToSubfolder ? $limitToSubfolder . $filename : $filename;
         $isTemplate = preg_match("/(.html|.twig)\$/u", $filename);
         if ($isTemplate) {
             $filteredTemplates[$filenameIncludingSubfolder] = $filename;
         }
     }
     // Render field
     return craft()->templates->render('_includes/forms/select', array('name' => $name, 'value' => $value, 'options' => $filteredTemplates));
 }
开发者ID:alexrubin,项目名称:Craft-TemplateSelect,代码行数:35,代码来源:TemplateSelect_SelectFieldType.php

示例14: getIterator

 public function getIterator()
 {
     if (!$this->loaded) {
         $this->load();
     }
     return parent::getIterator();
 }
开发者ID:brainsware,项目名称:bacon,代码行数:7,代码来源:Collection.php

示例15: getSettingsHtml

 public function getSettingsHtml()
 {
     $pluginSettings = craft()->plugins->getPlugin('placid')->getSettings();
     // Get placid requests and send them to the widget settings
     $requests = craft()->placid_requests->findAllRequests();
     $requestsArray = array('' => 'No request selected');
     foreach ($requests as $request) {
         $requestsArray[$request->handle] = $request->name;
     }
     $templatesPath = craft()->path->getSiteTemplatesPath() . $pluginSettings->widgetTemplatesPath;
     $templates = IOHelper::getFolderContents($templatesPath, TRUE);
     $templatesArray = array('' => Craft::t('No template selected'));
     if (!$templates) {
         $templatesArray = array('' => 'Cannot find templates');
         Craft::log('Cannot find templates in path "' . $templatesPath . '"', LogLevel::Error);
     } else {
         // Turn array into ArrayObject
         $templates = new \ArrayObject($templates);
         // Iterate over template list
         // * Remove full path
         // * Remove folders from list
         for ($list = $templates->getIterator(); $list->valid(); $list->next()) {
             $filename = $list->current();
             $filename = str_replace($templatesPath, '', $filename);
             $filenameIncludingSubfolder = $filename;
             $isTemplate = preg_match("/(.html|.twig)\$/u", $filename);
             if ($isTemplate) {
                 $templatesArray[$filenameIncludingSubfolder] = $filename;
             }
         }
     }
     return craft()->templates->render('placid/_widgets/request/settings', array('requests' => $requestsArray, 'templates' => $templatesArray, 'settings' => $this->getSettings()));
 }
开发者ID:andyra,项目名称:tes,代码行数:33,代码来源:Placid_RequestWidget.php


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