Overview

Namespaces

  • LeanMapper
    • Exception
    • Reflection
    • Relationship

Classes

  • Entity
  • Repository
  • Result
  • Row
  • Overview
  • Namespace
  • Class

Class Entity

Base class for custom entities

Abstract
Namespace: LeanMapper
Author: Vojtěch Kohout
Located at Entity.php
Methods summary
public
# __construct( LeanMapper\Row|Traversable|array|null $arg = null )

Parameters

$arg

Throws

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

Returns value of given field

Returns value of given field

Parameters

$name

Returns

mixed

Throws

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

Sets value of given field

Sets value of given field

Parameters

$name
$value

Throws

LeanMapper\Exception\InvalidMethodCallException
LeanMapper\Exception\InvalidValueException
LeanMapper\Exception\MemberAccessException
public mixed
# __call( string $name, array $arguments, array $arguments,… )

Calls __get() or __set() method when get<$name> or set<$name> methods don't exist

Calls __get() or __set() method when get<$name> or set<$name> methods don't exist

Parameters

$name
$arguments
$arguments,…

Returns

mixed

Throws

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

Performs a mass value assignment (using setters)

Performs a mass value assignment (using setters)

Parameters

$values
$whitelist

Throws

LeanMapper\Exception\InvalidArgumentException
public boolean
# isModified( )

Tells whether entity is in modified state

Tells whether entity is in modified state

Returns

boolean
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
# detach( )

Marks entity as detached (it means non-persisted)

Marks entity as detached (it means non-persisted)

public array
# getData( )

Returns array of high-level fields with values

Returns array of high-level fields with values

Returns

array
public array
# getRowData( )

Returns array of low-level fields with values

Returns array of low-level fields with values

Returns

array
public array
# getModifiedRowData( )

Returns array of modified low-level fields with new values

Returns array of modified low-level fields with new values

Returns

array
public
# markAsUpdated( )

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

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

public
# markAsCreated( integer $id, string $table, DibiConnection $connection )

Marks entity as persisted

Marks entity as persisted

Parameters

$id
$table
$connection
protected static LeanMapper\Reflection\EntityReflection
# getReflection( )

Returns

LeanMapper\Reflection\EntityReflection
protected array
# createCollection( array $entities )

Parameters

$entities

Returns

array
Properties summary
protected LeanMapper\Row $row
#
protected static LeanMapper\Reflection\EntityReflection[] $reflections
# array()
tharos/leanmapper v1.4.0 API documentation API documentation generated by ApiGen