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


PHP IteratorIterator::__construct方法代碼示例

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


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

示例1: __construct

 /**
  * Ensures that the inner iterator is both Traversable and Countable
  *
  * {@inheritdoc}
  *
  * @throws InvalidArgumentException
  */
 public function __construct(\Traversable $iterator)
 {
     if (!$iterator instanceof \Countable) {
         throw new InvalidArgumentException('The inner iterator for an ItemIterator must be Countable.');
     }
     parent::__construct($iterator);
 }
開發者ID:risyasin,項目名稱:webpagetest,代碼行數:14,代碼來源:ItemIterator.php

示例2: __construct

 /**
  * constructor
  *
  * @param Diggin_Scraper_Evaluator_Abstract $callback
  */
 public function __construct(\Diggin\Scraper\Evaluator\AbstractEvaluator $callback)
 {
     if ($filters = $callback->getProcess()->getFilters()) {
         $callback = $this->_apply($callback, $filters);
     }
     return parent::__construct($callback);
 }
開發者ID:sasezaki,項目名稱:Diggin_Scraper,代碼行數:12,代碼來源:Iterator.php

示例3: __construct

 public function __construct(FileInterface $file, FileSpec $spec, RecordSpecRecognizerInterface $recognizer, ValueFormatterInterface $formatter)
 {
     parent::__construct($file);
     $this->spec = $spec;
     $this->recognizer = $recognizer;
     $this->formatter = $formatter;
 }
開發者ID:SaveYa,項目名稱:FixedWidth,代碼行數:7,代碼來源:LineToReaderIterator.php

示例4: __construct

 public function __construct($iterator = null)
 {
     if (is_array($iterator)) {
         $iterator = new ArrayIterator($iterator);
     }
     parent::__construct($iterator);
 }
開發者ID:arduanov,項目名稱:pipes,代碼行數:7,代碼來源:TestIterator.php

示例5: __construct

 /**
  * @inheritDoc
  */
 public function __construct($path, $separator = ',')
 {
     $file = new SplFileObject($path);
     $file->setFlags(SplFileObject::READ_CSV | SplFileObject::READ_AHEAD | SplFileObject::SKIP_EMPTY);
     $file->setCsvControl($separator);
     parent::__construct($file);
 }
開發者ID:ExpandOnline,項目名稱:CakePHPUtil,代碼行數:10,代碼來源:CsvFileIterator.php

示例6: __construct

 /**
  *
  * @param array $data
  * @param \MUtil_Model_ModelAbstract $model
  * @param boolean $formatted
  * @return \Gems_FormattedData
  */
 public function __construct($data, \MUtil_Model_ModelAbstract $model, $formatted = true)
 {
     $this->data = parent::__construct(new \ArrayObject($data));
     $this->model = $model;
     $this->setFormatted($formatted);
     return $this;
 }
開發者ID:GemsTracker,項目名稱:gemstracker-library,代碼行數:14,代碼來源:FormattedData.php

示例7: __construct

 public function __construct($iterator, $reducer)
 {
     if (!is_callable($reducer)) {
         throw new Exception('must pass valid reducer callback to this iterator');
     }
     $this->reducer = $reducer;
     parent::__construct($iterator);
 }
開發者ID:jlogsdon,項目名稱:phpDocumentor,代碼行數:8,代碼來源:ArrayReduce.php

示例8: __construct

 public function __construct(Iterator $iterator, $selector)
 {
     parent::__construct($iterator);
     if ($selector === null) {
         throw new InvalidArgumentException("Selector must not be null.");
     }
     $this->selector = $selector;
 }
開發者ID:robations,項目名稱:linq,代碼行數:8,代碼來源:SelectIterator.php

示例9: __construct

 /**
  * Constructor
  *
  * @param PMF_Category $parent Parent PMF_Category object
  * 
  * @return void
  */
 public function __construct(PMF_Category_Tree_DataProvider_Interface $dataProvider, PMF_Category $parent = NULL)
 {
     $parentId = $parent ? (int) $parent->getId() : 0;
     $resultset = $dataProvider->getData($parentId);
     parent::__construct($resultset);
     $this->parent = $parent;
     $this->dataProvider = $dataProvider;
 }
開發者ID:nosch,項目名稱:phpMyFAQ,代碼行數:15,代碼來源:Tree.php

示例10: __construct

 public function __construct(IIterator $outerIterator, IIterator $innerIterator)
 {
     parent::__construct($outerIterator);
     self::__constructIterator();
     $this->outerIterator =& $this->iterator;
     $this->innerIterator = $innerIterator;
     $this->innerValuesIterator = new EmptyIterator();
 }
開發者ID:timetoogo,項目名稱:pinq,代碼行數:8,代碼來源:JoinIterator.php

示例11: __construct

 public function __construct(Traversable $iterator, $classNameModel)
 {
     parent::__construct($iterator);
     $this->classNameModel = $classNameModel;
     if (!is_subclass_of($classNameModel, Internals\Model::className()) && !in_array(Internals\Model::className(), class_parents($classNameModel))) {
         throw new ObjectException("{$classNameModel} must be subclass of " . Internals\Model::className());
     }
 }
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:8,代碼來源:modelbuilder.php

示例12: __construct

 public function __construct(\Traversable $iterator, $callback)
 {
     if (!is_callable($callback)) {
         throw new \InvalidArgumentException(sprintf('Callback should be callable, "%s" given.', gettype($callback)));
     }
     parent::__construct($iterator);
     $this->callback = $callback;
 }
開發者ID:wouterj,項目名稱:fred,代碼行數:8,代碼來源:MapIterator.php

示例13: __construct

 /**
  * @param \Traversable   $iterator Traversable iterator
  * @param array|\Closure $callback Callback used for iterating
  *
  * @throws InvalidArgumentException if the callback if not callable
  */
 public function __construct(\Traversable $iterator, $callback)
 {
     parent::__construct($iterator);
     if (!is_callable($callback)) {
         throw new InvalidArgumentException('The callback must be callable');
     }
     $this->callback = $callback;
 }
開發者ID:jorjoh,項目名稱:Varden,代碼行數:14,代碼來源:MapIterator.php

示例14: __construct

 public function __construct(\Traversable $iterator, $callback)
 {
     if (!is_callable($callback)) {
         throw new \InvalidArgumentException("Provided callback should be callable. Got " . gettype($callback));
     }
     parent::__construct($iterator);
     $this->callback = $callback;
 }
開發者ID:bweston92,項目名稱:done-process,代碼行數:8,代碼來源:MapIterator.php

示例15: ArrayIterator

 function __construct(\Iterator $iterator, $flags = CachingIterator::CALL_TOSTRING)
 {
     $flags = $this->validateFlags($flags);
     if ($flags & self::FULL_CACHE) {
         $this->fullCacheIterator = new ArrayIterator();
     }
     $this->flags = $flags;
     parent::__construct($iterator);
 }
開發者ID:badlamer,項目名稱:hhvm,代碼行數:9,代碼來源:CachingIterator.php


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