\cachePagination

This Cache tries to load big Data into Chunks and handles the access to save memory and execution time, because it let's to the Database some Operations like Sorting and Searching

Summary

Methods
Properties
Constants
__get()
__isset()
__dependencies()
__shortcuts()
__destruct()
__construct()
initIndex()
getIndex()
initObject()
get()
getDirect()
getAssocTag()
getAssocTagDirect()
reset()
sort()
search()
$dependencies
$shortcuts
$singleton
$class_hash
No constants found
No protected methods found
$strCacheKey
$intItemsPerChunk
$arrQuerys
$strID
$strTablename
$index
$data
N/A
getObject()
calculateChunkID()
$_shorts
$_shorts_loaded
$_class_index
N/A

Properties

$dependencies

$dependencies : 

Type

$shortcuts

$shortcuts : 

Type

$singleton

$singleton : 

Type

$class_hash

$class_hash : 

Type

$strCacheKey

$strCacheKey : 

Type

$intItemsPerChunk

$intItemsPerChunk : 

Type

$arrQuerys

$arrQuerys : 

Type

$strID

$strID : 

Type

$strTablename

$strTablename : 

Type

$index

$index : 

Type

$data

$data : 

Type

$_shorts

$_shorts : 

Type

$_shorts_loaded

$_shorts_loaded : 

Type

$_class_index

$_class_index : 

Type

Methods

__get()

__get(  $name) 

Parameters

$name

__isset()

__isset(  $name) 

Parameters

$name

__dependencies()

__dependencies() 

__shortcuts()

__shortcuts() 

__destruct()

__destruct() 

__construct()

__construct(string  $strCacheKey, string  $strID, string  $strTableName, string  $arrQuerys = array('index' => '', 'chunk' => '', 'direct' => '', 'tag_direct' => ''), \number  $intItemsPerChunk = 50) 

Constructor

Parameters

string $strCacheKey
  • Name of the Cache Key
string $strID
  • Name of the Primary Key
string $strTableName
  • Name of the Table, e.g. __items
string $arrQuerys
  • Array with specific Querys, if the generic Query won't work
\number $intItemsPerChunk
  • Items per Chunk, Default 50

initIndex()

initIndex() : boolean

Builds the Index-File with all Primary IDs

Returns

boolean

getIndex()

getIndex() : \array:

Returns an array with all Primary IDs

Returns

\array: —

IDs

initObject()

initObject(integer  $intObjectID) : boolean

Gets a Object from the Database, saves it to the Cache-Chunks

Parameters

integer $intObjectID

Returns

boolean

get()

get(integer  $intObjectID, string  $strObjectTag = false) : \array/boolean

Returns an Object; You can filter the returned data for a specific Column

Parameters

integer $intObjectID
string $strObjectTag

Returns

\array/boolean —

Data

getDirect()

getDirect(integer  $intObjectID, string  $strObjectTag = false) : \array/boolean

Returns an Object direct from the Database; You can filter the returned data for a specific Column

Parameters

integer $intObjectID
string $strObjectTag

Returns

\array/boolean —

Data

getAssocTag()

getAssocTag(string  $strObjectTag) : array

Returns an Array where the Index is the ObjectID, and the Value is the ObjectTag Value E.g. getAssocTagDirect("item_name") returns array(1 => 'Axt', 2 => 'Handschuhe', .

..)

Parameters

string $strObjectTag

Returns

array —

IDs

getAssocTagDirect()

getAssocTagDirect(string  $strObjectTag) : array

Returns an Array directly from the Database where the Index is the ObjectID, and the Value is the ObjectTag Value E.g. getAssocTagDirect("item_name") returns array(1 => 'Axt', 2 => 'Handschuhe', .

..)

Parameters

string $strObjectTag

Returns

array —

IDs

reset()

reset(array  $mixedIDs = false) : boolean

Reset Cache and Index

Parameters

array $mixedIDs

Returns

boolean

sort()

sort(string  $strObjectTag, string  $strSortDirection = "asc") : array

Sort for a specific column

Parameters

string $strObjectTag

Column

string $strSortDirection

Sort-direction

Returns

array —

IDs

search()

search(string  $strObjectTag, string  $strSearchValue, boolean  $allowParts = false) : array

Search for a specific Tag-Value

Parameters

string $strObjectTag

Column

string $strSearchValue

SearchValue

boolean $allowParts

False if Result must be identical with SearchValue, True if SearchValue can be a part of result

Returns

array —

IDs

getObject()

getObject(integer  $intObjectID) : \array/boolean

Internal function for getting Object from Cache

Parameters

integer $intObjectID

Returns

\array/boolean —

Data

calculateChunkID()

calculateChunkID(integer  $intObjectID) : \number

Calculates the Chunk-ID for a ObjectID

Parameters

integer $intObjectID

Returns

\number