PHP Class LeanMapper\Row

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

Méthodes publiques

Méthode Description
__construct ( Result $result, integer $id )
__get ( string $name ) : mixed Gets value of given column
__isset ( string $name ) : boolean Tells whether Row has given column and is not null
__set ( string $name, mixed $value ) Sets value of given column
__unset ( string $name ) Unsets given column
addToReferencing ( array $values, string $table, string | null $viaColumn = null, Filtering $filtering = null, string | null $strategy = null ) Adds new data entry to referencing Result
attach ( integer $id, string $table ) Marks Row as attached
cleanReferencedRowsCache ( string | null $table = null, string | null $viaColumn = null ) Cleans in-memory cache with referenced rows
cleanReferencingAddedAndRemovedMeta ( string $table, string | null $viaColumn = null, Filtering $filtering = null, string | null $strategy = null )
cleanReferencingRowsCache ( string | null $table = null, string | null $viaColumn = null ) Cleans in-memory cache with referencing rows
createReferencingDataDifference ( string $table, string | null $viaColumn = null, Filtering $filtering = null, string | null $strategy = null ) : DataDifference
detach ( ) Detaches Row (it means mark it as non-persisted)
getData ( ) : array Returns values of columns
getMapper ( ) : leanmapper\IMapper | null
getModifiedData ( ) : array Returns values of columns that were modified
getResultProxy ( string $proxyClass = 'LeanMapper\ResultProxy' ) : ResultProxy
hasColumn ( string $name ) : boolean Tells whether Row has given column
hasConnection ( ) : boolean
isDetached ( ) : boolean Tells whether Row is in detached state
isModified ( ) : boolean Tells whether Row is in modified state
markAsUpdated ( ) Marks Row as non-modified (isModified returns false right after this method call)
referenced ( string $table, string | null $viaColumn = null, Filtering $filtering = null ) : Row | null Gets referenced Row instance
referencing ( string $table, string | null $viaColumn = null, Filtering $filtering = null, string | null $strategy = null ) : Row[] Gets array of Row instances referencing current Row
removeFromReferencing ( array $values, string $table, string | null $viaColumn = null, Filtering $filtering = null, string | null $strategy = null ) Remove given data entry from referencing Result
setConnection ( Connection $connection )
setMapper ( leanmapper\IMapper $mapper )
setReferencedRow ( self $row = null, string $viaColumn )

Method Details

__construct() public méthode

public __construct ( Result $result, integer $id )
$result Result
$id integer

__get() public méthode

Gets value of given column
public __get ( string $name ) : mixed
$name string
Résultat mixed

__isset() public méthode

Tells whether Row has given column and is not null
public __isset ( string $name ) : boolean
$name string
Résultat boolean

__set() public méthode

Sets value of given column
public __set ( string $name, mixed $value )
$name string
$value mixed

__unset() public méthode

Unsets given column
public __unset ( string $name )
$name string

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 = null )
$values array
$table string
$viaColumn string | null
$filtering Filtering
$strategy string | null

attach() public méthode

Marks Row as attached
public attach ( integer $id, string $table )
$id integer
$table string

cleanReferencedRowsCache() public méthode

Cleans in-memory cache with referenced rows
public cleanReferencedRowsCache ( 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 = null )
$table string
$viaColumn string | null
$filtering Filtering
$strategy string | null

cleanReferencingRowsCache() public méthode

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

createReferencingDataDifference() public méthode

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

detach() public méthode

Detaches Row (it means mark it as non-persisted)
public detach ( )

getData() public méthode

Returns values of columns
public getData ( ) : array
Résultat array

getMapper() public méthode

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

getModifiedData() public méthode

Returns values of columns that were modified
public getModifiedData ( ) : array
Résultat array

getResultProxy() public méthode

public getResultProxy ( string $proxyClass = 'LeanMapper\ResultProxy' ) : ResultProxy
$proxyClass string
Résultat ResultProxy

hasColumn() public méthode

Tells whether Row has given column
public hasColumn ( string $name ) : boolean
$name string
Résultat boolean

hasConnection() public méthode

public hasConnection ( ) : boolean
Résultat boolean

isDetached() public méthode

Tells whether Row is in detached state
public isDetached ( ) : boolean
Résultat boolean

isModified() public méthode

Tells whether Row is in modified state
public isModified ( ) : boolean
Résultat boolean

markAsUpdated() public méthode

Marks Row as non-modified (isModified returns false right after this method call)
public markAsUpdated ( )

referenced() public méthode

Gets referenced Row instance
public referenced ( string $table, string | null $viaColumn = null, Filtering $filtering = null ) : Row | null
$table string
$viaColumn string | null
$filtering Filtering
Résultat Row | null

referencing() public méthode

Gets array of Row instances referencing current Row
public referencing ( string $table, string | null $viaColumn = null, Filtering $filtering = null, string | null $strategy = null ) : Row[]
$table string
$viaColumn string | null
$filtering Filtering
$strategy string | null
Résultat Row[]

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 = null )
$values array
$table string
$viaColumn string | null
$filtering Filtering
$strategy string | null

setConnection() public méthode

public setConnection ( Connection $connection )
$connection Connection

setMapper() public méthode

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

setReferencedRow() public méthode

public setReferencedRow ( self $row = null, string $viaColumn )
$row self
$viaColumn string