當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。