当前位置: 首页>>代码示例>>PHP>>正文


PHP ArrayIterator::__construct方法代码示例

本文整理汇总了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);
 }
开发者ID:snikch,项目名称:ergo,代码行数:12,代码来源:RouteMapMatch.php

示例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);
     }
 }
开发者ID:Phennim,项目名称:symfony1,代码行数:12,代码来源:sfOutputEscaperSafe.class.php

示例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);
 }
开发者ID:paul-m,项目名称:sitemap_verify,代码行数:36,代码来源:HtmlCrawler.php

示例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());
 }
开发者ID:JSreactor,项目名称:MarketCrater.com,代码行数:13,代码来源:template.class.php

示例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;
 }
开发者ID:swco,项目名称:appnexusapi,代码行数:13,代码来源:Response.php

示例6: __construct

 public function __construct(array $filesArray = array())
 {
     $files = array_map(function ($file) {
         return new MockSplFileInfo($file);
     }, $filesArray);
     parent::__construct($files);
 }
开发者ID:saj696,项目名称:pipe,代码行数:7,代码来源:MockFileListIterator.php

示例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);
     }
 }
开发者ID:atelierspierrot,项目名称:markdown-extended,代码行数:12,代码来源:ContentCollection.php

示例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);
 }
开发者ID:99designs,项目名称:ergo,代码行数:12,代码来源:RouteMatch.php

示例9: __construct

 public function __construct($array)
 {
     if (is_object($array)) {
         $array = $array->toArray();
     }
     parent::__construct($array);
 }
开发者ID:norfil,项目名称:SonataPageBundle,代码行数:7,代码来源:RecursiveBlockIterator.php

示例10: __construct

 public function __construct(array $files = [], FileSystemInterface $fileSystem = null)
 {
     foreach ($files as $key => $file) {
         $files[$key] = new File($file, $fileSystem);
     }
     parent::__construct($files);
 }
开发者ID:jaakon,项目名称:upit,代码行数:7,代码来源:Collection.php

示例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);
 }
开发者ID:Weysan,项目名称:ExcelArrayAccess,代码行数:25,代码来源:ExcelArray.php

示例12: __construct

 public function __construct()
 {
     $input = array();
     $input[self::REGEX_USE] = $this->useMacro();
     $input[self::REGEX_SPLICE] = $this->spliceMacro();
     parent::__construct($input);
 }
开发者ID:alexpw,项目名称:boris,代码行数:7,代码来源:Macros.php

示例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();
 }
开发者ID:meniam,项目名称:model,代码行数:31,代码来源:Schema.php

示例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);
 }
开发者ID:wwxgitcat,项目名称:habari,代码行数:7,代码来源:superglobal.php

示例15: __construct

 /**
  * Constructs Collection object
  *
  * @param mixed $data data
  */
 public function __construct($data = null)
 {
     parent::__construct([]);
     if ($data) {
         $this->append($data);
     }
 }
开发者ID:clean,项目名称:data,代码行数:12,代码来源:Collection.php


注:本文中的ArrayIterator::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。