本文整理汇总了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);
}
示例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;
}
示例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);
}
示例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;
}
}
示例5: __construct
public function __construct($data = null)
{
if (null !== $data && is_string($data)) {
$this->fromString($data);
} else {
parent::__construct($data);
}
}
示例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");
}
}
示例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");
}
}
示例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();
}
示例9: __construct
public function __construct($data = array())
{
$newData = [];
foreach ($data as $item) {
$newData[] = new TodoItem($item);
}
parent::__construct($newData);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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");
}
}
示例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";
}
示例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);
}