本文整理汇总了PHP中ArrayIterator::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP ArrayIterator::__construct方法的具体用法?PHP ArrayIterator::__construct怎么用?PHP ArrayIterator::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArrayIterator
的用法示例。
在下文中一共展示了ArrayIterator::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @param string $name
* @param array $parameters
* @params array $tags
*/
public function __construct($name, $parameters, $tags = null)
{
$this->_name = $name;
$this->_parameters = $parameters;
$this->_tags = $tags ? $tags : array();
parent::__construct($parameters);
}
示例2: __construct
/**
* Constructor.
*
* @param mixed $value The value to mark as safe
*/
public function __construct($value)
{
$this->value = $value;
if (is_array($value) || is_object($value)) {
parent::__construct($value);
}
}
示例3: __construct
/**
* Constructor method.
*
* @param Crawler $crawler
* A crawler object which already contains info about the page we're
* scraping.
* @param UrlBuilder $page
* URL builder object from which we can derive the URL of the page we want
* to scrape.
*/
public function __construct(Crawler $crawler, UrlBuilder $base_url)
{
$pages = array();
$externals = array();
$parse_crawler = $crawler->filter('a, link, script, img');
foreach ($parse_crawler as $element) {
$attr = '';
switch ($element->tagName) {
case 'a':
case 'link':
$attr = 'href';
break;
case 'script':
case 'img':
$attr = 'src';
}
$link_on_the_page = $element->getAttribute($attr);
if ($link_on_the_page) {
$url = new UrlBuilder($link_on_the_page, $base_url);
// Key is URL without fragment.
$url_key = $url->toUrl(FALSE);
$externals[$url_key] = $url;
}
}
parent::__construct($externals);
}
示例4: __construct
/**
* put your comment there...
*
* @param mixed $templates
* @return CJTInstallerTemplate
*/
public function __construct($templates)
{
// Initialize!
$this->model = CJTModel::getInstance('template');
// Initialize Iterator!
parent::__construct(is_array($templates) ? $templates : array());
}
示例5: __construct
/**
* @param array $services
* @param string $status
* @param int $count
* @param int $startElement
*/
public function __construct(array $services, $status, $count, $startElement)
{
parent::__construct($services);
$this->status = $status;
$this->count = $count;
$this->startElement = $startElement;
}
示例6: __construct
public function __construct(array $filesArray = array())
{
$files = array_map(function ($file) {
return new MockSplFileInfo($file);
}, $filesArray);
parent::__construct($files);
}
示例7: __construct
/**
* Constructs a new collection being sure that data are all `\MarkdownExtended\API\ContentInterface`
*
* @param array $data
*/
public function __construct(array $data = array())
{
parent::__construct();
foreach ($data as $item) {
$this->append($item);
}
}
示例8: __construct
/**
* @param string $name
* @param array $parameters
* @params array $tags
*/
public function __construct($name, $parameters, $metadata = array())
{
$this->_name = $name;
$this->_parameters = $parameters;
$this->_metadata = $metadata;
parent::__construct($parameters);
}
示例9: __construct
public function __construct($array)
{
if (is_object($array)) {
$array = $array->toArray();
}
parent::__construct($array);
}
示例10: __construct
public function __construct(array $files = [], FileSystemInterface $fileSystem = null)
{
foreach ($files as $key => $file) {
$files[$key] = new File($file, $fileSystem);
}
parent::__construct($files);
}
示例11: __construct
public function __construct($filename = null, $sheet = 0)
{
$this->filename = $filename;
if (file_exists($filename)) {
/* on charge le contenu du fichier dans l'objet phpExcel */
$inputFileType = PHPExcel_IOFactory::identify($filename);
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$this->phpExcel = $objReader->load($filename);
/* on implémente dans le tableau */
// Get worksheet dimensions
$sheet = $this->phpExcel->getSheet($sheet);
$highestRow = $sheet->getHighestRow();
$highestColumn = $sheet->getHighestColumn();
// Loop through each row of the worksheet in turn
for ($row = 1; $row <= $highestRow; $row++) {
// Read a row of data into an array
$rowData = $sheet->rangeToArray('A' . $row . ':' . $highestColumn . $row, NULL, TRUE, FALSE);
$this->container[] = $rowData[0];
}
} else {
$this->phpExcel = new PHPExcel();
$this->phpExcel->setActiveSheetIndex($sheet);
}
parent::__construct($this->container);
}
示例12: __construct
public function __construct()
{
$input = array();
$input[self::REGEX_USE] = $this->useMacro();
$input[self::REGEX_SPLICE] = $this->spliceMacro();
parent::__construct($input);
}
示例13: __construct
public function __construct($name, DbAdapter $dbAdapter)
{
if ($dbAdapter) {
$this->_db = $dbAdapter;
}
$this->_name = preg_replace('#[^a-z0-9\\_\\-]#si', '', $name);
$this->getDb()->query('USE ' . $this->getName());
//$metadata = new \Zend\Db\Metadata\Metadata($dbAdapter);
$sql = 'show tables';
$tableNames = $dbAdapter->fetchCol($sql);
/** @var Table[] $tables */
$tables = array();
if (!empty($tableNames)) {
foreach ($tableNames as $tableName) {
if ($tableName[0] == '_') {
continue;
}
$tables[] = new Table($tableName, $this);
}
}
foreach ($tables as $table) {
$this->_tableByTableNameRegistry[$table->getName()] = $table;
/** @var Column $column */
foreach ($table as $column) {
$this->_tableNameListByTableFieldNameRegistry[$column->getName()][] = $table->getName();
}
}
parent::__construct($tables);
$this->initIndex();
$this->initTableLinks();
}
示例14: __construct
public function __construct($array)
{
if (!is_array($array) && !$array instanceof SuperGlobal) {
throw new Exception('Parameter must be array or SuperGlobal');
}
parent::__construct($array);
}
示例15: __construct
/**
* Constructs Collection object
*
* @param mixed $data data
*/
public function __construct($data = null)
{
parent::__construct([]);
if ($data) {
$this->append($data);
}
}