Overview

Namespaces

  • LeanMapper
    • Exception
    • Reflection
    • Relationship

Classes

  • Connection
  • DataDifference
  • DefaultMapper
  • Entity
  • Events
  • Filtering
  • Fluent
  • Repository
  • Result
  • Row

Interfaces

  • IMapper
  • Overview
  • Namespace
  • Class

Class Entity

Base class for concrete entities

Abstract
Namespace: LeanMapper
Author: Vojtěch Kohout
Located at 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 )

Gets value of given property

Gets value of given property

Parameters

$name

Returns

mixed

Throws

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

Sets value of given property

Sets value of given property

Parameters

$name
$value

Throws

LeanMapper\Exception\InvalidMethodCallException
LeanMapper\Exception\InvalidValueException
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
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
# markAsAttached( integer $id, string $table, LeanMapper\Connection $connection )

Marks entity as attached

Marks entity as attached

Parameters

$id
$table
$connection
public
# detach( )

Marks entity as detached

Marks entity as detached

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
# useMapper( LeanMapper\IMapper $mapper )

Provides an mapper for entity

Provides an mapper for entity

Parameters

$mapper

Throws

LeanMapper\Exception\InvalidMethodCallException
LeanMapper\Exception\InvalidStateException
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 array
# createCollection( array $entities )

Allows encapsulate set of entities in custom collection

Allows encapsulate set of entities in custom collection

Parameters

$entities

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 $mapper
#
protected static LeanMapper\Reflection\EntityReflection[] $reflections
# array()
tharos/leanmapper v2.0.1 API documentation API documentation generated by ApiGen