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


PHP Collection::__construct方法代码示例

本文整理汇总了PHP中Collection::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Collection::__construct方法的具体用法?PHP Collection::__construct怎么用?PHP Collection::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Collection的用法示例。


在下文中一共展示了Collection::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($data)
 {
     parent::__construct($data);
     $this->_dataStore = $this->data = $data;
     $this->pages = 1;
     $this->perPage = count($this->_dataStore);
 }
开发者ID:phutureproof,项目名称:Gravel,代码行数:7,代码来源:EntityCollection.php

示例2: __construct

 /**
  * @param array $elements
  * @param int $currentPage
  * @param int $count
  * @param int $pageSize
  */
 public function __construct(array $elements, int $currentPage, int $count = null, $pageSize = 20)
 {
     parent::__construct($elements);
     $this->currentPage = $currentPage;
     $this->count = $count;
     $this->pageSize = $pageSize;
 }
开发者ID:cawaphp,项目名称:cawa,代码行数:13,代码来源:CollectionPaged.php

示例3: __construct

 /**
  * Constructor
  *
  * @param array $points An array of at least two points with
  * which to build the LineString
  */
 public function __construct($points = array())
 {
     if (count($points) == 1) {
         throw new Exception("Cannot construct a LineString with a single point");
     }
     // Call the Collection constructor to build the LineString
     parent::__construct($points);
 }
开发者ID:drupdateio,项目名称:gvj,代码行数:14,代码来源:LineString.class.php

示例4: __construct

 public function __construct()
 {
     parent::__construct();
     foreach ($this->types as $type_id => $class_name) {
         $item = $this->create_item($type_id);
         $this->members[$type_id] = $item;
     }
 }
开发者ID:119155012,项目名称:kals,代码行数:8,代码来源:Output_language_variable_collection.php

示例5: __construct

 public function __construct($data = null)
 {
     if (null !== $data && is_string($data)) {
         $this->fromString($data);
     } else {
         parent::__construct($data);
     }
 }
开发者ID:pr-of-it,项目名称:t4,代码行数:8,代码来源:QueryString.php

示例6: __construct

 /**
  * Constructor
  *
  * The first linestring is the outer ring
  * The subsequent ones are holes
  * All linestrings should be a closed LineString
  *
  * @param array $linestrings The LineString array
  */
 public function __construct(array $linestrings)
 {
     if (count($linestrings) > 0) {
         parent::__construct($linestrings);
     } else {
         throw new Exception("Polygon without an exterior ring");
     }
 }
开发者ID:happy-code-com,项目名称:PHP5-Shape-File-Parser,代码行数:17,代码来源:Polygon.class.php

示例7: __construct

 /**
  * Constructor
  *
  * @param array $positions The Point array
  */
 public function __construct(array $positions)
 {
     if (count($positions) > 1) {
         parent::__construct($positions);
     } else {
         throw new Exception("Linestring with less than two points");
     }
 }
开发者ID:juacas,项目名称:moodle-mod_treasurehunt,代码行数:13,代码来源:LineString.class.php

示例8:

 /**
  * @param Route $route a Route thru which the IWebContext was passed
  * @param IRouteTable $routeTable table of routes that was looked up to find the appropriate Route
  * @param IWebContext $webContext context that was passed thru the Route
  * @param Trace $parentTrace inital Trace which's handling failed cascading usage of a fallback Route
  */
 function __construct(Route $route, IRouteTable $routeTable, IWebContext $webContext, Trace $parentTrace = null)
 {
     $this->route = $route;
     $this->routeTable = $routeTable;
     $this->webContext = $webContext;
     $this->parentTrace = $parentTrace;
     parent::__construct();
 }
开发者ID:phoebius,项目名称:ajax-example,代码行数:14,代码来源:Trace.class.php

示例9: __construct

 public function __construct($data = array())
 {
     $newData = [];
     foreach ($data as $item) {
         $newData[] = new TodoItem($item);
     }
     parent::__construct($newData);
 }
开发者ID:pambuk,项目名称:simpletodo,代码行数:8,代码来源:TodoCollection.php

示例10: __construct

 public function __construct($refresh = false, $callback = null)
 {
     parent::__construct($this->repository);
     $this->fetch($refresh, $callback);
     $this->data = json_decode($this->raw);
     foreach ($this->data as $slug => $data) {
         $this->items[$slug] = new Package($data, $this->type);
     }
 }
开发者ID:qbi,项目名称:datenknoten.me,代码行数:9,代码来源:Plugins.php

示例11:

 function __construct($id, $scheme, $table, $fields = "*", $from = "", $where = "", $limit_size = 30)
 {
     $sql = "SELECT * FROM `{$table}` WHERE `id` = {$id}";
     //		dbg($sql);
     $this->v = $this->queryRow($sql);
     //		dbg($this->v);
     $this->scheme = $scheme;
     parent::__construct($table, $fields = "*", $from = "", $where = "", $limit_size);
 }
开发者ID:rigidus,项目名称:cobutilniki,代码行数:9,代码来源:EnvGroup.php

示例12: __construct

 /**
  * Class construct
  * @param array|\ArrayObject|null $array
  * @return void
  */
 public function __construct($array = null, array $options = null)
 {
     $options = array_merge(null === $options ? array() : $options, array('indexType' => static::INDEX_ASSOCIATIVE, 'readonly' => false));
     if (array_key_exists('name', $options)) {
         $this->setName($options['name']);
     }
     parent::__construct($array, $options);
     $this->setFlags(self::ARRAY_AS_PROPS);
 }
开发者ID:nimbles,项目名称:Framework,代码行数:14,代码来源:Plugin.php

示例13: __construct

 /**
  * Constructor
  *
  * The first linestring is the outer ring
  * The subsequent ones are holes
  * All linestrings should be linearrings
  *
  * @param array $linestrings The LineString array
  */
 public function __construct(array $linestrings)
 {
     // the GeoJSON spec (http://geojson.org/geojson-spec.html) says nothing about linestring count.
     // What should we do ?
     if (count($linestrings) > 0) {
         parent::__construct($linestrings);
     } else {
         throw new Exception("Polygon without an exterior ring");
     }
 }
开发者ID:juacas,项目名称:moodle-mod_treasurehunt,代码行数:19,代码来源:Polygon.class.php

示例14: substr

 function __construct($name, $config)
 {
     parent::__construct($config);
     $this->statut_id = substr($this->get_code_from_name($name), 1);
     $query = "select gestion_libelle from notice_statut where id_notice_statut = " . $this->statut_id;
     $result = mysql_query($query);
     if (mysql_num_rows($result)) {
         $this->statut_libelle = mysql_result($result, 0, 0);
     }
     $this->type = "statut";
 }
开发者ID:bouchra012,项目名称:PMB,代码行数:11,代码来源:Statut.php

示例15: __construct

 public function __construct($cSaveMode, array $aItems = array())
 {
     if ($aItems) {
         if (!self::isAModelArray($aItems)) {
             throw new \Exception(__METHOD__ . "() : L'argument #2 doit être un tableau d'instance(s) de Model.");
         }
         $this->_sModelName = self::getModelNameFromInstance($aItems[array_rand($aItems)]);
     }
     $this->setDefaultSaveMode($cSaveMode);
     parent::__construct($aItems);
 }
开发者ID:subtonix,项目名称:aouka_lunch,代码行数:11,代码来源:ModelCollection.php


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