本文整理匯總了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);
}
示例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);
}
示例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;
}
示例4: __construct
public function __construct($iterator = null)
{
if (is_array($iterator)) {
$iterator = new ArrayIterator($iterator);
}
parent::__construct($iterator);
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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();
}
示例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());
}
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}