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 Entity

Base class for concrete entities

Abstract
Namespace: LeanMapper
Author: Vojtěch Kohout
Located at LeanMapper/Entity.php
Methods summary
public static LeanMapper\Reflection\EntityReflection
# getReflection( LeanMapper\IMapper $mapper = null )

Gets reflection of current entity

Gets reflection of current entity

Parameters

$mapper

Returns

LeanMapper\Reflection\EntityReflection
public
# __construct( LeanMapper\Row|Traversable|array|null $arg = null )

Parameters

$arg

Throws

LeanMapper\Exception\InvalidArgumentException
public mixed
# __get( string $name )

Parameters

$name

Returns

mixed

Throws

LeanMapper\Exception\InvalidMethodCallException
LeanMapper\Exception\MemberAccessException
public
# __set( string $name, mixed $value )

Parameters

$name
$value

Throws

LeanMapper\Exception\InvalidMethodCallException
LeanMapper\Exception\MemberAccessException
public boolean
# __isset( string $name )

Tells whether given property exists and is not null

Tells whether given property exists and is not null

Parameters

$name

Returns

boolean

Throws

LeanMapper\Exception\Exception
public mixed|
# __call( string $name, array $arguments )

Parameters

$name
$arguments

Returns

mixed|

Throws

LeanMapper\Exception\InvalidMethodCallException
LeanMapper\Exception\InvalidArgumentException
public
# assign( array|Traversable $values, array $whitelist = null )

Performs mass value assignment (using setters)

Performs mass value assignment (using setters)

Parameters

$values
$whitelist

Throws

LeanMapper\Exception\InvalidArgumentException
public array
# getData( array $whitelist = null )

Gets high-level values of properties

Gets high-level values of properties

Parameters

$whitelist

Returns

array
public array
# getRowData( )

Gets low-level values of underlying Row columns

Gets low-level values of underlying Row columns

Returns

array
public array
# getModifiedRowData( )

Gets low-level values of underlying Row columns that were modified

Gets low-level values of underlying Row columns that were modified

Returns

array
public array
# getHasManyRowDifferences( )

Gets current M:N differences

Gets current M:N differences

Returns

array
public boolean
# isModified( )

Tells whether entity was modified

Tells whether entity was modified

Returns

boolean
public
# markAsUpdated( )

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

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

public
# detach( )

Detaches entity

Detaches entity

public
# attach( integer $id )

Attaches entity

Attaches entity

Parameters

$id

Throws

LeanMapper\Exception\InvalidStateException
public boolean
# isDetached( )

Tells whether entity is in detached state (like newly created entity)

Tells whether entity is in detached state (like newly created entity)

Returns

boolean
public
# makeAlive( LeanMapper\IEntityFactory $entityFactory = null, LeanMapper\Connection $connection = null, LeanMapper\IMapper $mapper = null )

Provides dependencies

Provides dependencies

Parameters

$entityFactory
$connection
$mapper

Throws

LeanMapper\Exception\InvalidArgumentException
LeanMapper\Exception\InvalidStateException
public array
# __sleep( )

Returns

array
protected mixed
# get( LeanMapper\Reflection\Property|string $property, array $filterArgs = [] )

Parameters

$property
$filterArgs

Returns

mixed

Throws

LeanMapper\Exception\InvalidValueException
LeanMapper\Exception\InvalidStateException
LeanMapper\Exception\MemberAccessException
protected
# set( LeanMapper\Reflection\Property|string $property, mixed $value )

Parameters

$property
$value

Throws

LeanMapper\Exception\InvalidMethodCallException
LeanMapper\Exception\InvalidValueException
LeanMapper\Exception\MemberAccessException
protected LeanMapper\Reflection\EntityReflection
# getCurrentReflection( )

Gets current entity's reflection (cached in memory)

Gets current entity's reflection (cached in memory)

Returns

LeanMapper\Reflection\EntityReflection
protected LeanMapper\Entity|LeanMapper\Entity[]
# getValueByPropertyWithRelationship( LeanMapper\Reflection\Property|string $property, LeanMapper\Filtering $targetTableFiltering = null, LeanMapper\Filtering $relationshipTableFiltering = null )

Parameters

$property
micro-optimalization
$targetTableFiltering
$relationshipTableFiltering

Returns

LeanMapper\Entity|LeanMapper\Entity[]

Throws

LeanMapper\Exception\Exception
protected
# assignEntityToProperty( LeanMapper\Entity $entity, LeanMapper\Reflection\Property|string $property )

Parameters

$entity
$property
micro-optimalization

Throws

LeanMapper\Exception\InvalidMethodCallException
protected LeanMapper\ImplicitFilters
# createImplicitFilters( string $entityClass, LeanMapper\Caller $caller = null )

Parameters

$entityClass
$caller

Returns

LeanMapper\ImplicitFilters
protected array
# mergeFilters( array $filters1, array $filters2 )

Parameters

$filters1
$filters2

Returns

array
protected
# initDefaults( )

Allows initialize properties' default values

Allows initialize properties' default values

Constants summary
string ACTION_ADD
# 'add'
string ACTION_REMOVE
# 'remove'
Properties summary
protected LeanMapper\Row $row
#
protected LeanMapper\IMapper|null $mapper
#
protected LeanMapper\IEntityFactory|null $entityFactory
#
protected static LeanMapper\Reflection\EntityReflection[] $reflections
# []
tharos/leanmapper v3.3.0 API documentation API documentation generated by ApiGen