PHP 클래스 LeanMapper\Entity

저자: Vojtěch Kohout
파일 보기 프로젝트 열기: tharos/leanmapper 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$entityFactory leanmapper\IEntityFactory
$mapper leanmapper\IMapper
$reflections LeanMapper\Reflection\EntityReflection[]
$row Row

공개 메소드들

메소드 설명
__call ( string $name, array $arguments ) : mixed | void
__construct ( Row | Traversabl\Traversable | array | null $arg = null )
__get ( string $name ) : mixed
__isset ( string $name ) : boolean Tells whether given property exists and is not null
__set ( string $name, mixed $value )
__sleep ( ) : array
assign ( array | Traversabl\Traversable $values, array $whitelist = null ) Performs mass value assignment (using setters)
attach ( integer $id ) Attaches entity
detach ( ) Detaches entity
getData ( array $whitelist = null ) : array Gets high-level values of properties
getHasManyRowDifferences ( ) : array Gets current M:N differences
getModifiedRowData ( ) : array Gets low-level values of underlying Row columns that were modified
getReflection ( leanmapper\IMapper $mapper = null ) : EntityReflection Gets reflection of current entity
getRowData ( ) : array Gets low-level values of underlying Row columns
isDetached ( ) : boolean Tells whether entity is in detached state (like newly created entity)
isModified ( ) : boolean Tells whether entity was modified
makeAlive ( leanmapper\IEntityFactory $entityFactory = null, Connection $connection = null, leanmapper\IMapper $mapper = null ) Provides dependencies
markAsUpdated ( ) Marks entity as non-modified (isModified returns false right after this method call)

보호된 메소드들

메소드 설명
assignEntityToProperty ( Entity $entity = null, Property | string $property )
createImplicitFilters ( string $entityClass, Caller $caller = null ) : ImplicitFilters
get ( $property, array $filterArgs = [] ) : mixed
getCurrentReflection ( ) : EntityReflection Gets current entity's reflection (cached in memory)
getValueByPropertyWithRelationship ( Property | string $property, Filtering $targetTableFiltering = null, Filtering $relationshipTableFiltering = null ) : Entity | Entity[]
initDefaults ( ) Allows initialize properties' default values
mergeFilters ( array $filters1, array $filters2 ) : array
set ( Property | string $property, mixed $value )

비공개 메소드들

메소드 설명
addToOrRemoveFrom ( string $action, string $name, mixed $arg )
checkConsistency ( Property $property, string $mapperClass, Entity $entity )
checkMethodArgumentsCount ( integer $expectedCount, array $arguments, string $methodName )
getBelongsToManyValue ( Property $property, LeanMapper\Relationship\BelongsToMany $relationship, Filtering $filtering = null ) : Entity[]
getBelongsToOneValue ( Property $property, LeanMapper\Relationship\BelongsToOne $relationship, Filtering $filtering = null ) : Entity
getHasManyValue ( Property $property, HasMany $relationship, Filtering $targetTableFiltering = null, Filtering $relTableFiltering = null ) : Entity[]
getHasOneValue ( Property $property, HasOne $relationship, Filtering $filtering = null ) : Entity
setEntityFactory ( leanmapper\IEntityFactory $entityFactory )
useMapper ( leanmapper\IMapper $mapper ) Provides an mapper for entity

메소드 상세

__call() 공개 메소드

public __call ( string $name, array $arguments ) : mixed | void
$name string
$arguments array
리턴 mixed | void

__construct() 공개 메소드

public __construct ( Row | Traversabl\Traversable | array | null $arg = null )
$arg Row | Traversabl\Traversable | array | null

__get() 공개 메소드

public __get ( string $name ) : mixed
$name string
리턴 mixed

__isset() 공개 메소드

Tells whether given property exists and is not null
public __isset ( string $name ) : boolean
$name string
리턴 boolean

__set() 공개 메소드

public __set ( string $name, mixed $value )
$name string
$value mixed

__sleep() 공개 메소드

public __sleep ( ) : array
리턴 array

assign() 공개 메소드

Performs mass value assignment (using setters)
public assign ( array | Traversabl\Traversable $values, array $whitelist = null )
$values array | Traversabl\Traversable
$whitelist array

assignEntityToProperty() 보호된 메소드

protected assignEntityToProperty ( Entity $entity = null, Property | string $property )
$entity Entity
$property LeanMapper\Reflection\Property | string micro-optimalization

attach() 공개 메소드

Attaches entity
public attach ( integer $id )
$id integer

createImplicitFilters() 보호된 메소드

protected createImplicitFilters ( string $entityClass, Caller $caller = null ) : ImplicitFilters
$entityClass string
$caller Caller
리턴 ImplicitFilters

detach() 공개 메소드

Detaches entity
public detach ( )

get() 보호된 메소드

protected get ( $property, array $filterArgs = [] ) : mixed
$property
$filterArgs array
리턴 mixed

getCurrentReflection() 보호된 메소드

Gets current entity's reflection (cached in memory)
protected getCurrentReflection ( ) : EntityReflection
리턴 LeanMapper\Reflection\EntityReflection

getData() 공개 메소드

Gets high-level values of properties
public getData ( array $whitelist = null ) : array
$whitelist array
리턴 array

getHasManyRowDifferences() 공개 메소드

Gets current M:N differences
public getHasManyRowDifferences ( ) : array
리턴 array

getModifiedRowData() 공개 메소드

Gets low-level values of underlying Row columns that were modified
public getModifiedRowData ( ) : array
리턴 array

getReflection() 공개 정적인 메소드

Gets reflection of current entity
public static getReflection ( leanmapper\IMapper $mapper = null ) : EntityReflection
$mapper leanmapper\IMapper
리턴 LeanMapper\Reflection\EntityReflection

getRowData() 공개 메소드

Gets low-level values of underlying Row columns
public getRowData ( ) : array
리턴 array

getValueByPropertyWithRelationship() 보호된 메소드

protected getValueByPropertyWithRelationship ( Property | string $property, Filtering $targetTableFiltering = null, Filtering $relationshipTableFiltering = null ) : Entity | Entity[]
$property LeanMapper\Reflection\Property | string micro-optimalization
$targetTableFiltering Filtering
$relationshipTableFiltering Filtering
리턴 Entity | Entity[]

initDefaults() 보호된 메소드

Allows initialize properties' default values
protected initDefaults ( )

isDetached() 공개 메소드

Tells whether entity is in detached state (like newly created entity)
public isDetached ( ) : boolean
리턴 boolean

isModified() 공개 메소드

Tells whether entity was modified
public isModified ( ) : boolean
리턴 boolean

makeAlive() 공개 메소드

Provides dependencies
public makeAlive ( leanmapper\IEntityFactory $entityFactory = null, Connection $connection = null, leanmapper\IMapper $mapper = null )
$entityFactory leanmapper\IEntityFactory
$connection Connection
$mapper leanmapper\IMapper

markAsUpdated() 공개 메소드

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

mergeFilters() 보호된 메소드

protected mergeFilters ( array $filters1, array $filters2 ) : array
$filters1 array
$filters2 array
리턴 array

set() 보호된 메소드

protected set ( Property | string $property, mixed $value )
$property LeanMapper\Reflection\Property | string
$value mixed

프로퍼티 상세

$entityFactory 보호되어 있는 프로퍼티

protected IEntityFactory,leanmapper $entityFactory
리턴 leanmapper\IEntityFactory

$mapper 보호되어 있는 프로퍼티

protected IMapper,leanmapper $mapper
리턴 leanmapper\IMapper

$reflections 보호되어 있는 정적으로 프로퍼티

protected static EntityReflection[],LeanMapper\Reflection $reflections
리턴 LeanMapper\Reflection\EntityReflection[]

$row 보호되어 있는 프로퍼티

protected Row,leanmapper $row
리턴 Row