本文整理汇总了PHP中RecursiveIteratorIterator::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP RecursiveIteratorIterator::__construct方法的具体用法?PHP RecursiveIteratorIterator::__construct怎么用?PHP RecursiveIteratorIterator::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RecursiveIteratorIterator
的用法示例。
在下文中一共展示了RecursiveIteratorIterator::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor.
*
* @param LoaderInterface $loader The templating loader
* @param string $bundle The current bundle name
* @param string $path The directory
* @param RecursiveIterator $iterator The inner iterator
*/
public function __construct(LoaderInterface $loader, $bundle, $path, \RecursiveIterator $iterator)
{
$this->loader = $loader;
$this->bundle = $bundle;
$this->path = $path;
parent::__construct($iterator);
}
示例2: __construct
/**
* Creates a new CategoryNodeList instance.
*
* @param string $objectType
* @param integer $parentCategoryID
* @param boolean $includeDisabledCategories
* @param array<integer> $excludedCategoryIDs
*/
public function __construct($objectType, $parentCategoryID = 0, $includeDisabledCategories = false, array $excludedCategoryIDs = array()) {
if (empty($this->nodeClassName)) {
$this->nodeClassName = str_replace('List', '', get_class($this));
if (!class_exists($this->nodeClassName)) {
throw new SystemException("Unknown category node class '".$this->nodeClassName."'.");
}
}
$this->parentCategoryID = $parentCategoryID;
// get parent category
if (!$this->parentCategoryID) {
// empty node
$parentCategory = new Category(null, array(
'categoryID' => 0,
'objectTypeID' => CategoryHandler::getInstance()->getObjectTypeByName($objectType)->objectTypeID
));
}
else {
$parentCategory = CategoryHandler::getInstance()->getCategory($this->parentCategoryID);
if ($parentCategory === null) {
throw new SystemException("There is no category with id '".$this->parentCategoryID."'");
}
}
parent::__construct(new $this->nodeClassName($parentCategory, $includeDisabledCategories, $excludedCategoryIDs), \RecursiveIteratorIterator::SELF_FIRST);
}
示例3: __construct
/**
* Load the iterator.
*/
public function __construct($it, $dsn, $table)
{
$this->_it = $it;
$this->_dsn = $dsn;
$this->_table = $table;
parent::__construct($this->_it, self::LEAVES_ONLY);
}
示例4: __construct
/**
* @param IItem $root
* @param int $maxDepth
* @param array $filter
*/
public function __construct(IItem $root, $maxDepth = -1, $filter = array())
{
parent::__construct($root, parent::SELF_FIRST);
parent::setMaxDepth($maxDepth);
$this->filter = $filter;
$this->accessor = PropertyAccess::getPropertyAccessor();
$this->iterated = new \SplObjectStorage();
}
示例5: __construct
/**
* Constructor
*
* @param DatabaseRowsetInterface $rowset
* @param integer $max_level The maximum allowed level. 0 is used for any level
* @return DatabaseIteratorRecursive
*/
public function __construct(DatabaseRowsetInterface $rowset, $max_level = 0)
{
parent::__construct(static::_createInnerIterator($rowset), \RecursiveIteratorIterator::SELF_FIRST);
//Set the max iteration level
if (isset($max_level)) {
$this->setMaxLevel($max_level);
}
}
示例6: __construct
/**
* Construct from a path.
* @param $path directory to iterate
*/
public function __construct($path)
{
try {
parent::__construct(new RecursiveCachingIterator(new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::KEY_AS_FILENAME), CachingIterator::CALL_TOSTRING | CachingIterator::CATCH_GET_CHILD), parent::SELF_FIRST);
} catch (Exception $e) {
die($e->getMessage());
}
}
示例7: __construct
/**
* Constructor
*
* @param ControllerToolbarInterface $toolbar
* @param integer $max_level The maximum allowed level. 0 is used for any level
* @return ControllerToolbarIteratorRecursive
*/
public function __construct(ControllerToolbarInterface $toolbar, $max_level = 0)
{
parent::__construct(static::_createInnerIterator($toolbar), \RecursiveIteratorIterator::SELF_FIRST);
//Set the max iteration level
if (isset($max_level)) {
$this->setMaxLevel($max_level);
}
}
示例8: __construct
public function __construct($sourcePath, $destBasePath)
{
$sourcePath = realpath($sourcePath);
$sourcePath = rtrim($sourcePath, '\\/') . '/';
$destBasePath = realpath($destBasePath);
$destBasePath = rtrim($destBasePath, '\\/') . '/';
parent::__construct(new mediaDirectoryRecursiveIterator($sourcePath, $sourcePath, $destBasePath));
}
示例9:
function __construct($iterator, $mode = \RecursiveIteratorIterator::SELF_FIRST, array $flags = null)
{
if (method_exists($iterator, 'getIterator')) {
$iterator = $iterator->getIterator();
}
if (!$iterator instanceof Iterator) {
throw new \Exception('Iterator must be instance of Data\\Tree\\Node\\Iterator, ' . get_class($iterator) . ' provided.');
}
parent::__construct($iterator, $mode, $flags);
}
示例10: Exception
function __construct($iterator)
{
if (method_exists($iterator, 'getIterator')) {
$iterator = $iterator->getIterator();
}
if (!$iterator instanceof NestedSetIterator) {
throw new Exception('Iterator must be instance of NestedSetIterator');
}
parent::__construct($iterator, \RecursiveIteratorIterator::SELF_FIRST);
}
示例11: __construct
public function __construct($path)
{
$path = realpath($path);
if (!file_exists($path)) {
throw new Exception("Path {$path} could not be found.");
} elseif (!is_dir($path)) {
throw new Exception("Path {$path} is not a directory.");
}
parent::__construct(new RecursiveDirectoryIterator($path));
}
示例12: __construct
/**
* Construct from RecursiveDualIterator
*
* @param RecursiveDualIterator $it RecursiveDualIterator
* @param integer $mode Should be LEAVES_ONLY
* @param integer $flags Should be 0
*/
public function __construct(RecursiveDualIterator $it, $mode = self::LEAVES_ONLY, $flags = 0)
{
parent::__construct($it);
}
示例13: __construct
/**
* @param it iterator to use as inner iterator
* @param ritFlags flags passed to RecursiveIteratoIterator (parent)
* @param citFlags flags passed to RecursiveCachingIterator (for hasNext)
* @param mode mode passed to RecursiveIteratoIterator (parent)
*/
public function __construct(RecursiveIterator $it, $ritFlags = self::BYPASS_KEY, $citFlags = CachingIterator::CATCH_GET_CHILD, $mode = self::SELF_FIRST)
{
parent::__construct(new RecursiveCachingIterator($it, $citFlags), $mode, $ritFlags);
$this->ritFlags = $ritFlags;
}
示例14: __construct
public function __construct(Errors $iterator)
{
parent::__construct($iterator, \RecursiveIteratorIterator::LEAVES_ONLY);
}
示例15: __construct
/**
* @param \RecursiveIterator $iterator
* @param int $mode
* @param int $flags
*/
public function __construct(\RecursiveIterator $iterator, $mode = \RecursiveIteratorIterator::SELF_FIRST, $flags = 0)
{
parent::__construct($iterator, $mode, $flags);
}