inc\classes\Pages.phpView Source

Show: PublicProtectedPrivateinherited
Table of Contents
Pages

Displays content by pages

Author
Sergey Dilong  
License
GPL-2.0  
Package
Temply-Account\Services  

\Pages

Package: Temply-Account\Services
Pages class

Cuts and offsets the content

Author
Sergey Dilong  
License
GPL-2.0  

Constants

>VConstant  SYSTEM_MAX = 500
Max global count
>VConstant  SYSTEM_MIN = 1
Min global count

Properties

>VPropertyprivatearray<mixed,mixed> $data = array()

Data for pagination

Default valuearray()Details
Type
array<mixed,mixed>
>VPropertyprivatearray<mixed,mixed> $default_params = array(0, 10, 1, 1)
static

Default settings

Default valuearray(0, 10, 1, 1)Details
Type
array<mixed,mixed>
>VPropertyprivatearray<mixed,mixed> $default_params_user = array("_", "_", "_", "_")
static

User's universal defaults

Default valuearray("_", "_", "_", "_")Details
Type
array<mixed,mixed>
>VPropertyprivateinteger $id = 0

Pages element ID

Default value0Details
Type
integer
>VPropertyprivatearray<mixed,mixed> $id_register = array()
static

All IDs

Default valuearray()Details
Type
array<mixed,mixed>
>VPropertyprivatearray<mixed,integer> $limits = array(self::SYSTEM_MIN, self::SYSTEM_MAX)

Limits for the Pages

Default valuearray(self::SYSTEM_MIN, self::SYSTEM_MAX)Details
Type
array<mixed,integer>
>VPropertyprivatearray<mixed,mixed> $p = array()

Settings for the object *

Default valuearray()Details
Type
array<mixed,mixed>
>VPropertyprivatearray<mixed,mixed> $parsed = false
static

All got rules

Default valuefalseDetails
Type
array<mixed,mixed>

Methods

methodprivateRegID(mixed $id) : void

RegID

Parameters
NameTypeDescription
$idmixed

Control ID to register

methodpublic__construct(mixed $data, mixed $id, mixed $limits = array(), mixed $default = array()) : void

__construct

Creates Pages object

The Pages object is used to give via API big arrays by parts

Parameters
NameTypeDescription
$datamixed

The array to display

$idmixed

ID to control the object (could be not just unique)

$limitsmixed

Count limits [min, max]

$defaultmixed

Default rules [offset, count, page, jumpAllowed]. You can fall back to default values using "_" string or by not adding them if they are at the end.

Throws
ExceptionDescription
\apiException[104] Wrong rules, critical parse errors
methodprivateapplyRules(mixed $rules) : void

Just saves the rules

Parameters
NameTypeDescription
$rulesmixed

Rules to save

methodpublicget() : void

Gets the data using rules

methodpublicgetCurrentRules() : void

Public function to get all rules that are already in use

methodprivategetRules() : void

Searches for parsed rules for current id or returns fallback config ("_"s)

methodprivateparseRules(mixed $rules) : void

Parse Rules

Checks and autofills given rules

Parameters
NameTypeDescription
$rulesmixed

The rules to work with

methodprivateprepareRules() : void
static

Gets users By-ID Control data from request

Documentation was generated by phpDocumentor v2.9.0.