當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Collection::current方法代碼示例

本文整理匯總了PHP中Cake\Collection\Collection::current方法的典型用法代碼示例。如果您正苦於以下問題:PHP Collection::current方法的具體用法?PHP Collection::current怎麽用?PHP Collection::current使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Cake\Collection\Collection的用法示例。


在下文中一共展示了Collection::current方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: current

 /**
  * Returns the current element in the target collection after inserting
  * the value from the source collection into the specified path.
  *
  * @return mixed
  */
 public function current()
 {
     $row = parent::current();
     if (!$this->_validValues) {
         return $row;
     }
     $pointer =& $row;
     foreach ($this->_path as $step) {
         if (!isset($pointer[$step])) {
             return $row;
         }
         $pointer =& $pointer[$step];
     }
     $pointer[$this->_target] = $this->_values->current();
     return $row;
 }
開發者ID:JesseDarellMoore,項目名稱:CS499,代碼行數:22,代碼來源:InsertIterator.php

示例2: valid

 /**
  * Returns whether or not the iterator has more elements
  *
  * @return bool
  */
 public function valid()
 {
     if ($this->_buffer->offsetExists($this->_index)) {
         $current = $this->_buffer->offsetGet($this->_index);
         $this->_current = $current['value'];
         $this->_key = $current['key'];
         return true;
     }
     $valid = parent::valid();
     if ($valid) {
         $this->_current = parent::current();
         $this->_key = parent::key();
         $this->_buffer->push(['key' => $this->_key, 'value' => $this->_current]);
     }
     $this->_finished = !$valid;
     return $valid;
 }
開發者ID:eddiePower,項目名稱:cakephp,代碼行數:22,代碼來源:BufferedIterator.php

示例3: current

 /**
  * Returns the value returned by the callback after passing the current value in
  * the iteration
  *
  * @return mixed
  */
 public function current()
 {
     $callback = $this->_callback;
     return $callback(parent::current(), $this->key(), $this->_innerIterator);
 }
開發者ID:JesseDarellMoore,項目名稱:CS499,代碼行數:11,代碼來源:ReplaceIterator.php

示例4: current

 /**
  * Returns the column value defined in $path or null if the path could not be
  * followed
  *
  * @return mixed
  */
 public function current()
 {
     $current = parent::current();
     return $this->_extract($current, $this->_path);
 }
開發者ID:maitrepylos,項目名稱:nazeweb,代碼行數:11,代碼來源:ExtractIterator.php

示例5: current

 /**
  * Returns the column value defined in $path or null if the path could not be
  * followed
  *
  * @return mixed
  */
 public function current()
 {
     $extractor = $this->_extractor;
     return $extractor(parent::current());
 }
開發者ID:CakeDC,項目名稱:cakephp,代碼行數:11,代碼來源:ExtractIterator.php


注:本文中的Cake\Collection\Collection::current方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。