Overview

Namespaces

  • LeanMapper
    • Bridges
      • Nette
        • DI
    • Exception
    • Reflection
    • Relationship

Classes

  • Caller
  • Connection
  • DataDifference
  • DefaultEntityFactory
  • DefaultMapper
  • Entity
  • EntityDataDecoder
  • Events
  • Filtering
  • FilteringResult
  • FilteringResultDecorator
  • Fluent
  • ImplicitFilters
  • Repository
  • Result
  • ResultProxy
  • Row

Interfaces

  • IEntityFactory
  • IMapper
  • Overview
  • Namespace
  • Class

Class Result

Set of related data, heart of Lean Mapper

LeanMapper\Result implements Iterator
Namespace: LeanMapper
Author: Vojtěch Kohout
Located at LeanMapper/Result.php
Methods summary
public static LeanMapper\Result
# createInstance( Dibi\Row|Dibi\Row[] $data, string $table, LeanMapper\Connection $connection, LeanMapper\IMapper $mapper )

Creates new common instance (it means persisted)

Creates new common instance (it means persisted)

Parameters

$data
$table
$connection
$mapper

Returns

LeanMapper\Result

Throws

LeanMapper\Exception\InvalidArgumentException
public static LeanMapper\Result
# createDetachedInstance( )

Creates new detached instance (it means non-persisted)

Creates new detached instance (it means non-persisted)

Returns

LeanMapper\Result
public static
# enableSerialization( LeanMapper\Connection $connection )

Parameters

$connection
public
# setConnection( LeanMapper\Connection $connection )

Parameters

$connection

Throws

LeanMapper\Exception\InvalidStateException
public boolean
# hasConnection( )

Returns

boolean
public
# setMapper( LeanMapper\IMapper $mapper )

Parameters

$mapper
public LeanMapper\IMapper|null
# getMapper( )

Returns

LeanMapper\IMapper|null
public LeanMapper\Row|null
# getRow( integer $id = null )

Creates new Row instance pointing to specific row within Result

Creates new Row instance pointing to specific row within Result

Parameters

$id

Returns

LeanMapper\Row|null

Throws

LeanMapper\Exception\InvalidArgumentException
public mixed
# getDataEntry( mixed $id, string $key )

Gets value of given column from row with given id

Gets value of given column from row with given id

Parameters

$id
$key

Returns

mixed

Throws

LeanMapper\Exception\InvalidArgumentException
public
# setDataEntry( mixed $id, string $key, mixed $value )

Sets value of given column in row with given id

Sets value of given column in row with given id

Parameters

$id
$key
$value

Throws

LeanMapper\Exception\InvalidArgumentException
public boolean
# hasDataEntry( mixed $id, string $column )

Tells whether row with given id has given column

Tells whether row with given id has given column

Parameters

$id
$column

Returns

boolean
public
# unsetDataEntry( mixed $id, string $column )

Unsets given column in row with given id

Unsets given column in row with given id

Parameters

$id
$column

Throws

LeanMapper\Exception\InvalidArgumentException
LeanMapper\Exception\InvalidStateException
public
# addDataEntry( array $values )

Adds new data entry

Adds new data entry

Parameters

$values

Throws

LeanMapper\Exception\InvalidStateException
public
# removeDataEntry( array $values )

Removes given data entry

Removes given data entry

Parameters

$values

Throws

LeanMapper\Exception\InvalidStateException
public array
# getData( integer $id )

Returns values of columns of requested row

Returns values of columns of requested row

Parameters

$id

Returns

array
public array
# getModifiedData( integer $id )

Returns values of columns of requested row that were modified

Returns values of columns of requested row that were modified

Parameters

$id

Returns

array
public LeanMapper\DataDifference
# createDataDifference( )

Creates new DataDifference instance relevant to current Result state

Creates new DataDifference instance relevant to current Result state

Returns

LeanMapper\DataDifference
public boolean
# isModified( integer $id )

Tells whether requested row is in modified state

Tells whether requested row is in modified state

Parameters

$id

Returns

boolean
public boolean
# isDetached( )

Tells whether Result is in detached state (in means non-persisted)

Tells whether Result is in detached state (in means non-persisted)

Returns

boolean
public
# markAsUpdated( integer $id )

Marks requested row as non-modified (isModified returns false right after this method call)

Marks requested row as non-modified (isModified returns false right after this method call)

Parameters

$id

Throws

LeanMapper\Exception\InvalidMethodCallException
public
# attach( mixed $id, string $table )

Parameters

$id
$table

Throws

LeanMapper\Exception\InvalidStateException
public
# cleanAddedAndRemovedMeta( )
public LeanMapper\Row|null
# getReferencedRow( integer $id, string $table, string|null $viaColumn = null, LeanMapper\Filtering $filtering = null )

Creates new Row instance pointing to requested row in referenced Result

Creates new Row instance pointing to requested row in referenced Result

Parameters

$id
$table
$viaColumn
$filtering

Returns

LeanMapper\Row|null

Throws

LeanMapper\Exception\InvalidStateException
public LeanMapper\Row[]
# getReferencingRows( integer $id, string $table, string|null $viaColumn = null, LeanMapper\Filtering $filtering = null, string $strategy = null )

Creates new array of Row instances pointing to requested row in referencing Result

Creates new array of Row instances pointing to requested row in referencing Result

Parameters

$id
$table
$viaColumn
$filtering
$strategy

Returns

LeanMapper\Row[]

Throws

LeanMapper\Exception\InvalidStateException
public
# setReferencedResult( LeanMapper\Result $referencedResult, string $table, string $viaColumn = null )

Parameters

$referencedResult
$table
$viaColumn
public
# setReferencingResult( LeanMapper\Result $referencingResult, string $table, string $viaColumn = null, string $strategy = self::STRATEGY_IN )

Parameters

$referencingResult
$table
$viaColumn
$strategy
public
# addToReferencing( array $values, string $table, string|null $viaColumn = null, LeanMapper\Filtering $filtering = null, string|null $strategy = self::STRATEGY_IN )

Adds new data entry to referencing Result

Adds new data entry to referencing Result

Parameters

$values
$table
$viaColumn
$filtering
$strategy
public
# removeFromReferencing( array $values, string $table, string|null $viaColumn = null, LeanMapper\Filtering $filtering = null, string|null $strategy = self::STRATEGY_IN )

Remove given data entry from referencing Result

Remove given data entry from referencing Result

Parameters

$values
$table
$viaColumn
$filtering
$strategy
public LeanMapper\DataDifference
# createReferencingDataDifference( string $table, string|null $viaColumn = null, LeanMapper\Filtering $filtering = null, string|null $strategy = self::STRATEGY_IN )

Parameters

$table
$viaColumn
$filtering
$strategy

Returns

LeanMapper\DataDifference
public
# cleanReferencedResultsCache( string|null $table = null, string|null $viaColumn = null )

Cleans in-memory cache with referenced results

Cleans in-memory cache with referenced results

Parameters

$table
$viaColumn
public
# cleanReferencingResultsCache( string|null $table = null, string|null $viaColumn = null )

Cleans in-memory cache with referencing results

Cleans in-memory cache with referencing results

Parameters

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

Parameters

$table
$viaColumn
$filtering
$strategy
public LeanMapper\ResultProxy
# getProxy( string $proxyClass )

Parameters

$proxyClass

Returns

LeanMapper\ResultProxy

Throws

LeanMapper\Exception\InvalidArgumentException
public array
# __sleep( )

Returns

array
public
# __wakeup( )
public mixed
# current( )

Returns

mixed

Implementation of

Iterator::current()
public
# next( )

Implementation of

Iterator::next()
public integer
# key( )

Returns

integer

Implementation of

Iterator::key()
public boolean
# valid( )

Returns

boolean

Implementation of

Iterator::valid()
public
# rewind( )

Implementation of

Iterator::rewind()
Constants summary
string STRATEGY_IN
# 'in'
string STRATEGY_UNION
# 'union'
integer DETACHED_ROW_ID
# -1
string KEY_PRELOADED
# 'preloaded'
string KEY_FORCED
# 'forced'
integer ERROR_MISSING_COLUMN
# 1
Properties summary
protected LeanMapper\IMapper $mapper
#
tharos/leanmapper v3.1.1 API documentation API documentation generated by ApiGen