PHP Class LeanMapper\Result

Author: Vojtěch Kohout
Inheritance: implements Iterator
Afficher le fichier Open project: tharos/leanmapper Class Usage Examples

Protected Properties

Свойство Type Description
$mapper leanmapper\IMapper

Méthodes publiques

Méthode Description
__sleep ( ) : array
__wakeup ( )
addDataEntry ( array $values ) Adds new data entry
addToReferencing ( array $values, string $table, string | null $viaColumn = null, Filtering $filtering = null, string | null $strategy = self::STRATEGY_IN ) Adds new data entry to referencing Result
attach ( mixed $id, string $table )
cleanAddedAndRemovedMeta ( )
cleanReferencedResultsCache ( string | null $table = null, string | null $viaColumn = null ) Cleans in-memory cache with referenced results
cleanReferencingAddedAndRemovedMeta ( string $table, string | null $viaColumn = null, Filtering $filtering = null, string | null $strategy = self::STRATEGY_IN )
cleanReferencingResultsCache ( string | null $table = null, string | null $viaColumn = null ) Cleans in-memory cache with referencing results
createDataDifference ( ) : DataDifference Creates new DataDifference instance relevant to current Result state
createDetachedInstance ( ) : self Creates new detached instance (it means non-persisted)
createInstance ( Row | Row[] $data, string $table, Connection $connection, leanmapper\IMapper $mapper ) : self Creates new common instance (it means persisted)
createReferencingDataDifference ( string $table, string | null $viaColumn = null, Filtering $filtering = null, string | null $strategy = self::STRATEGY_IN ) : DataDifference
current ( ) : mixed
enableSerialization ( Connection $connection )
getData ( integer $id ) : array Returns values of columns of requested row
getDataEntry ( mixed $id, string $key ) : mixed Gets value of given column from row with given id
getMapper ( ) : leanmapper\IMapper | null
getModifiedData ( integer $id ) : array Returns values of columns of requested row that were modified
getProxy ( string $proxyClass ) : ResultProxy
getReferencedRow ( integer $id, string $table, string | null $viaColumn = null, Filtering $filtering = null ) : Row | null Creates new Row instance pointing to requested row in referenced Result
getReferencingRows ( integer $id, string $table, string | null $viaColumn = null, Filtering $filtering = null, string $strategy = null ) : Row[] Creates new array of Row instances pointing to requested row in referencing Result
getRow ( integer $id = null ) : Row | null Creates new Row instance pointing to specific row within Result
hasConnection ( ) : boolean
hasDataEntry ( mixed $id, string $column ) : boolean Tells whether row with given id has given column
isDetached ( ) : boolean Tells whether Result is in detached state (in means non-persisted)
isModified ( integer $id ) : boolean Tells whether requested row is in modified state
key ( ) : integer
markAsUpdated ( integer $id ) Marks requested row as non-modified (isModified returns false right after this method call)
next ( )
removeDataEntry ( array $values ) Removes given data entry
removeFromReferencing ( array $values, string $table, string | null $viaColumn = null, Filtering $filtering = null, string | null $strategy = self::STRATEGY_IN ) Remove given data entry from referencing Result
rewind ( )
setConnection ( Connection $connection )
setDataEntry ( mixed $id, string $key, mixed $value ) Sets value of given column in row with given id
setMapper ( leanmapper\IMapper $mapper )
setReferencedResult ( self $referencedResult, string $table, string $viaColumn = null )
setReferencingResult ( self $referencingResult, string $table, string $viaColumn = null, string $strategy = self::STRATEGY_IN )
unsetDataEntry ( mixed $id, string $column ) Unsets given column in row with given id
valid ( ) : boolean

Private Methods

Méthode Description
__construct ( array $data = null, string | null $table = null, Connection $connection = null, leanmapper\IMapper $mapper = null )
applyFiltering ( Fluent $statement, Filtering $filtering ) : FilteringResult | null
buildUnionStrategySql ( array $ids, string $table, string $viaColumn, Filtering $filtering = null ) : mixed
calculateArgumentsHash ( array $arguments ) : string
createTableSelection ( string $table, array $relatedKeys = null ) : Fluent
extractIds ( string $column ) : array
getReferencedResult ( string $table, string $viaColumn, Filtering $filtering = null ) : self
getReferencingResult ( string $table, string $viaColumn = null, Filtering $filtering = null, string $strategy = self::STRATEGY_IN ) : self
isAlias ( string $column ) : boolean
translateStrategy ( string | null $strategy ) : string
trimAlias ( string $column ) : string

Method Details

__sleep() public méthode

public __sleep ( ) : array
Résultat array

__wakeup() public méthode

public __wakeup ( )

addDataEntry() public méthode

Adds new data entry
public addDataEntry ( array $values )
$values array

addToReferencing() public méthode

Adds new data entry to referencing Result
public addToReferencing ( array $values, string $table, string | null $viaColumn = null, Filtering $filtering = null, string | null $strategy = self::STRATEGY_IN )
$values array
$table string
$viaColumn string | null
$filtering Filtering
$strategy string | null

attach() public méthode

public attach ( mixed $id, string $table )
$id mixed
$table string

cleanAddedAndRemovedMeta() public méthode

cleanReferencedResultsCache() public méthode

Cleans in-memory cache with referenced results
public cleanReferencedResultsCache ( string | null $table = null, string | null $viaColumn = null )
$table string | null
$viaColumn string | null

cleanReferencingAddedAndRemovedMeta() public méthode

public cleanReferencingAddedAndRemovedMeta ( string $table, string | null $viaColumn = null, Filtering $filtering = null, string | null $strategy = self::STRATEGY_IN )
$table string
$viaColumn string | null
$filtering Filtering
$strategy string | null

cleanReferencingResultsCache() public méthode

Cleans in-memory cache with referencing results
public cleanReferencingResultsCache ( string | null $table = null, string | null $viaColumn = null )
$table string | null
$viaColumn string | null

createDataDifference() public méthode

Creates new DataDifference instance relevant to current Result state
public createDataDifference ( ) : DataDifference
Résultat DataDifference

createDetachedInstance() public static méthode

Creates new detached instance (it means non-persisted)
public static createDetachedInstance ( ) : self
Résultat self

createInstance() public static méthode

Creates new common instance (it means persisted)
public static createInstance ( Row | Row[] $data, string $table, Connection $connection, leanmapper\IMapper $mapper ) : self
$data Dibi\Row | Dibi\Row[]
$table string
$connection Connection
$mapper leanmapper\IMapper
Résultat self

createReferencingDataDifference() public méthode

public createReferencingDataDifference ( string $table, string | null $viaColumn = null, Filtering $filtering = null, string | null $strategy = self::STRATEGY_IN ) : DataDifference
$table string
$viaColumn string | null
$filtering Filtering
$strategy string | null
Résultat DataDifference

current() public méthode

public current ( ) : mixed
Résultat mixed

enableSerialization() public static méthode

public static enableSerialization ( Connection $connection )
$connection Connection

getData() public méthode

Returns values of columns of requested row
public getData ( integer $id ) : array
$id integer
Résultat array

getDataEntry() public méthode

Gets value of given column from row with given id
public getDataEntry ( mixed $id, string $key ) : mixed
$id mixed
$key string
Résultat mixed

getMapper() public méthode

public getMapper ( ) : leanmapper\IMapper | null
Résultat leanmapper\IMapper | null

getModifiedData() public méthode

Returns values of columns of requested row that were modified
public getModifiedData ( integer $id ) : array
$id integer
Résultat array

getProxy() public méthode

public getProxy ( string $proxyClass ) : ResultProxy
$proxyClass string
Résultat ResultProxy

getReferencedRow() public méthode

Creates new Row instance pointing to requested row in referenced Result
public getReferencedRow ( integer $id, string $table, string | null $viaColumn = null, Filtering $filtering = null ) : Row | null
$id integer
$table string
$viaColumn string | null
$filtering Filtering
Résultat Row | null

getReferencingRows() public méthode

Creates new array of Row instances pointing to requested row in referencing Result
public getReferencingRows ( integer $id, string $table, string | null $viaColumn = null, Filtering $filtering = null, string $strategy = null ) : Row[]
$id integer
$table string
$viaColumn string | null
$filtering Filtering
$strategy string
Résultat Row[]

getRow() public méthode

Creates new Row instance pointing to specific row within Result
public getRow ( integer $id = null ) : Row | null
$id integer
Résultat Row | null

hasConnection() public méthode

public hasConnection ( ) : boolean
Résultat boolean

hasDataEntry() public méthode

Tells whether row with given id has given column
public hasDataEntry ( mixed $id, string $column ) : boolean
$id mixed
$column string
Résultat boolean

isDetached() public méthode

Tells whether Result is in detached state (in means non-persisted)
public isDetached ( ) : boolean
Résultat boolean

isModified() public méthode

Tells whether requested row is in modified state
public isModified ( integer $id ) : boolean
$id integer
Résultat boolean

key() public méthode

public key ( ) : integer
Résultat integer

markAsUpdated() public méthode

Marks requested row as non-modified (isModified returns false right after this method call)
public markAsUpdated ( integer $id )
$id integer

next() public méthode

public next ( )

removeDataEntry() public méthode

Removes given data entry
public removeDataEntry ( array $values )
$values array

removeFromReferencing() public méthode

Remove given data entry from referencing Result
public removeFromReferencing ( array $values, string $table, string | null $viaColumn = null, Filtering $filtering = null, string | null $strategy = self::STRATEGY_IN )
$values array
$table string
$viaColumn string | null
$filtering Filtering
$strategy string | null

rewind() public méthode

public rewind ( )

setConnection() public méthode

public setConnection ( Connection $connection )
$connection Connection

setDataEntry() public méthode

Sets value of given column in row with given id
public setDataEntry ( mixed $id, string $key, mixed $value )
$id mixed
$key string
$value mixed

setMapper() public méthode

public setMapper ( leanmapper\IMapper $mapper )
$mapper leanmapper\IMapper

setReferencedResult() public méthode

public setReferencedResult ( self $referencedResult, string $table, string $viaColumn = null )
$referencedResult self
$table string
$viaColumn string

setReferencingResult() public méthode

public setReferencingResult ( self $referencingResult, string $table, string $viaColumn = null, string $strategy = self::STRATEGY_IN )
$referencingResult self
$table string
$viaColumn string
$strategy string

unsetDataEntry() public méthode

Unsets given column in row with given id
public unsetDataEntry ( mixed $id, string $column )
$id mixed
$column string

valid() public méthode

public valid ( ) : boolean
Résultat boolean

Property Details

$mapper protected_oe property

protected IMapper,leanmapper $mapper
Résultat leanmapper\IMapper