PHP Class LeanMapper\Row

Author: Vojtěch Kohout
ファイルを表示 Open project: tharos/leanmapper Class Usage Examples

Public Methods

Method 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 method

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

__get() public method

Gets value of given column
public __get ( string $name ) : mixed
$name string
return mixed

__isset() public method

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

__set() public method

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

__unset() public method

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

addToReferencing() public method

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 method

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

cleanReferencedRowsCache() public method

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 method

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 method

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 method

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
return DataDifference

detach() public method

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

getData() public method

Returns values of columns
public getData ( ) : array
return array

getMapper() public method

public getMapper ( ) : leanmapper\IMapper | null
return leanmapper\IMapper | null

getModifiedData() public method

Returns values of columns that were modified
public getModifiedData ( ) : array
return array

getResultProxy() public method

public getResultProxy ( string $proxyClass = 'LeanMapper\ResultProxy' ) : ResultProxy
$proxyClass string
return ResultProxy

hasColumn() public method

Tells whether Row has given column
public hasColumn ( string $name ) : boolean
$name string
return boolean

hasConnection() public method

public hasConnection ( ) : boolean
return boolean

isDetached() public method

Tells whether Row is in detached state
public isDetached ( ) : boolean
return boolean

isModified() public method

Tells whether Row is in modified state
public isModified ( ) : boolean
return boolean

markAsUpdated() public method

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

referenced() public method

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

referencing() public method

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
return Row[]

removeFromReferencing() public method

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 method

public setConnection ( Connection $connection )
$connection Connection

setMapper() public method

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

setReferencedRow() public method

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