PHP 클래스 Jarves\Storage\AbstractStorage

Please do not handle 'permissionCheck' in $options. This is handled in \Jarves\Object. You will get in getList() a complex $pCondition object instead (if there are any ACL items) $pk is an array with following format array( '' => '' => ) example array( 'id' => 1234 )
파일 보기 프로젝트 열기: jarves/jarves 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$definition Jarves\Configuration\Object Cached the object definition.
$objectKey string The current object key.
$primaryKeys array Only keys.

공개 메소드들

메소드 설명
add ( array $values, array $targetPk = null, string $position = 'first', integer $scope = null ) : array
clear ( ) : boolean Do whatever is needed, to clear all items out of this object scope.
clearCache ( ) Clears the internal cache. This is called when the defined object has been changed.
configure ( string $objectKey, Object $definition ) Important call directly after the creation of this class.
drop ( ) : boolean Removes anything that is required to hold the data. E.g. SQL Tables, Drop Sequences, etc.
export ( Condition $condition = null ) : array Exports all data as array
getBranch ( array $pk = null, Condition $condition = null, integer $depth = 1, mixed $scope = null, array $options = null ) : array Returns a branch if the object is a nested set.
getBranchChildrenCount ( null $pk = null, Condition $condition = null, null $scope = null ) : array
getCount ( Condition $condition = null ) : integer
getDefinition ( )
getField ( string $fieldKey ) : array Returns a field definition.
getItem ( array $pk, array $options = null ) : array $pOptions is a array which can contain following options. All options are optional.
getItems ( array $filter = null, Condition $condition = null, array $options = null ) $pOptions is a array which can contain following options. All options are optional.
getNestedSubCondition ( Condition $condition ) : Condition Builds a condition for the sub-items check in \Jarves\Permissions::getListingCondition() for nested set objects.
getObjectKey ( ) : string Returns the object key.
getParent ( array $pk, array $options = null ) : mixed Returns the parent if exists otherwise false.
getParentId ( array $pk ) : array Returns parent's pk, if exists, otherwise null.
getParents ( array $pk ) : array Returns all parents.
getPrimaryKeys ( ) : array Returns the primary keys as array.
getRoots ( Condition $condition = null, array $options = null )
move ( array $pk, array $targetPk, string $position = 'first', $targetObjectKey = null ) : boolean Moves a item to a new position.
normalizePrimaryKey ( mixed $pk ) : array Normalizes a primary key, that is normally used inside PHP classes, since developers are lazy and we need to convert the lazy primary key to the full definition.
patch ( array $pk, array $values ) Patches a object entry. This means, only defined fields will be saved. Fields which are not defined will not be overwritten.
primaryStringToArray ( string $pk ) : array Converts given primary values from type string into proper normalized array definition.
remove ( array $pk )
search ( string $query, Condition $condition = null, integer $max = 20 ) : array | null Executes a search to this object, filter by $query and optional by a more complet condition $condition.
setDefinition ( $definition )
setPrimaryKeys ( $pks )
update ( array $pk, array $values ) Updates an object entry. This means, all fields which are not defined will be saved as NULL.

메소드 상세

add() 추상적인 공개 메소드

abstract public add ( array $values, array $targetPk = null, string $position = 'first', integer $scope = null ) : array
$values array
$targetPk array If nested set
$position string `first` (child), `last` (last child), `prev` (sibling), `next` (sibling)
$scope integer If nested set with scope
리턴 array inserted/new primary key/s always as a array.

clear() 추상적인 공개 메소드

Do whatever is needed, to clear all items out of this object scope.
abstract public clear ( ) : boolean
리턴 boolean

clearCache() 공개 메소드

Clears the internal cache. This is called when the defined object has been changed.
public clearCache ( )

configure() 공개 메소드

Important call directly after the creation of this class.
public configure ( string $objectKey, Object $definition )
$objectKey string
$definition Object

drop() 공개 메소드

Removes anything that is required to hold the data. E.g. SQL Tables, Drop Sequences, etc.
public drop ( ) : boolean
리턴 boolean

export() 공개 메소드

Exports all data as array
public export ( Condition $condition = null ) : array
$condition Jarves\Configuration\Condition
리턴 array

getBranch() 공개 메소드

Result should be: array( array(, '_children' => array(), '_childrenCount' => ), array(, '_children' => array(), '_childrenCount' => ), ... )
public getBranch ( array $pk = null, Condition $condition = null, integer $depth = 1, mixed $scope = null, array $options = null ) : array
$pk array
$condition Jarves\Configuration\Condition
$depth integer Started with one. One means, only the first level, no children at all.
$scope mixed
$options array
리턴 array

getBranchChildrenCount() 공개 메소드

public getBranchChildrenCount ( null $pk = null, Condition $condition = null, null $scope = null ) : array
$pk null
$condition Jarves\Configuration\Condition
$scope null
리턴 array

getCount() 추상적인 공개 메소드

abstract public getCount ( Condition $condition = null ) : integer
$condition Jarves\Configuration\Condition
리턴 integer

getDefinition() 공개 메소드

public getDefinition ( )

getField() 공개 메소드

Returns a field definition.
public getField ( string $fieldKey ) : array
$fieldKey string
리턴 array

getItem() 추상적인 공개 메소드

'fields' Limit the columns selection. Use a array or a comma separated list (like in SQL SELECT) If empty all columns will be selected. 'permissionCheck' Defines whether we check against the ACL or not. true or false. default false
abstract public getItem ( array $pk, array $options = null ) : array
$pk array
$options array
리턴 array

getItems() 추상적인 공개 메소드

'fields' Limit the columns selection. Use a array or a comma separated list (like in SQL SELECT) If empty all columns will be selected. 'offset' Offset of the result set (in SQL OFFSET) 'limit' Limits the result set (in SQL LIMIT) 'order' The column to order. Example: array( array('category' => 'asc'), array(title' => 'asc') ) 'permissionCheck' Defines whether we check against the ACL or not. true or false. default false
abstract public getItems ( array $filter = null, Condition $condition = null, array $options = null )
$filter array simple filter
$condition Jarves\Configuration\Condition complex filter condition
$options array

getNestedSubCondition() 공개 메소드

Builds a condition for the sub-items check in \Jarves\Permissions::getListingCondition() for nested set objects.
public getNestedSubCondition ( Condition $condition ) : Condition
$condition Jarves\Configuration\Condition
리턴 Jarves\Configuration\Condition

getObjectKey() 공개 메소드

Returns the object key.
public getObjectKey ( ) : string
리턴 string

getParent() 공개 메소드

Returns the parent if exists otherwise false.
public getParent ( array $pk, array $options = null ) : mixed
$pk array
$options array
리턴 mixed

getParentId() 공개 메소드

Returns parent's pk, if exists, otherwise null.
public getParentId ( array $pk ) : array
$pk array
리턴 array

getParents() 공개 메소드

Root object first. Each entry has to have also '_objectKey' as value.
public getParents ( array $pk ) : array
$pk array
리턴 array

getPrimaryKeys() 공개 메소드

Returns the primary keys as array.
public getPrimaryKeys ( ) : array
리턴 array [key1, key2, key3]

getRoots() 공개 메소드

public getRoots ( Condition $condition = null, array $options = null )
$condition Jarves\Configuration\Condition
$options array

move() 공개 메소드

Moves a item to a new position.
public move ( array $pk, array $targetPk, string $position = 'first', $targetObjectKey = null ) : boolean
$pk array Full PK as array
$targetPk array Full PK as array
$position string `first` (child), `last` (last child), `prev` (sibling), `next` (sibling)
$targetObjectKey
리턴 boolean

normalizePrimaryKey() 공개 메소드

Possible input: array('bla'), 'peter', 123, Output array('id' => 'bla'), array('id' => 'peter'), array('id' => 123) if the only primary key is named id.
public normalizePrimaryKey ( mixed $pk ) : array
$pk mixed
리턴 array A single primary key as array. Example: array('id' => 1).

patch() 추상적인 공개 메소드

Patches a object entry. This means, only defined fields will be saved. Fields which are not defined will not be overwritten.
abstract public patch ( array $pk, array $values )
$pk array
$values array

primaryStringToArray() 공개 메소드

This builds the array for the $pk for all of these methods inside this class. The primaryKey comes primarily from the REST API. admin/object/news/1 admin/objects?uri=news/1/2 where admin/object/news/ admin/objects?uri=news/ is this ID. 1/2/3 => array( array(id =>1),array(id =>2),array(id =>3) ) 1 => array(array(id => 1)) idFooBar => array( id => "idFooBar") idFoo/Bar => array(array(id => idFoo), array(id2 => "Bar")) 1,45/2,45 => array(array(id => 1, pid = 45), array(id => 2, pid=>45))
public primaryStringToArray ( string $pk ) : array
$pk string
리턴 array Always a array with primary keys as arrays too. So $return[0] is the first primary key array. Example array(array('id' => 4))

remove() 추상적인 공개 메소드

abstract public remove ( array $pk )
$pk array

setDefinition() 공개 메소드

public setDefinition ( $definition )

setPrimaryKeys() 공개 메소드

public setPrimaryKeys ( $pks )

update() 추상적인 공개 메소드

Updates an object entry. This means, all fields which are not defined will be saved as NULL.
abstract public update ( array $pk, array $values )
$pk array
$values array

프로퍼티 상세

$definition 공개적으로 프로퍼티

Cached the object definition.
public Object,Jarves\Configuration $definition
리턴 Jarves\Configuration\Object

$objectKey 공개적으로 프로퍼티

The current object key.
public string $objectKey
리턴 string

$primaryKeys 공개적으로 프로퍼티

Only keys.
public array $primaryKeys
리턴 array