PHP 클래스 Mongolid\DataMapper\EntityAssembler

This class is meant to do the opposite of the SchemaMapper.
또한 보기: http://martinfowler.com/eaaCatalog/dataTransferObject.html
파일 보기 프로젝트 열기: leroy-merlin-br/mongolid 1 사용 예제들

공개 메소드들

메소드 설명
assemble ( array | object $document, Schema $schema ) : mixed Builds an object from the provided data.

보호된 메소드들

메소드 설명
assembleDocumentsRecursively ( mixed $value, string $schemaClass ) : mixed Assembly multiple documents for the given $schemaClass recursively.
morphingTime ( mixed $entity ) : mixed Returns the return of polymorph method of the given entity if available.
prepareOriginalAttributes ( mixed $entity ) : mixed Stores original attributes from Entity if needed.

메소드 상세

assemble() 공개 메소드

Builds an object from the provided data.
public assemble ( array | object $document, Schema $schema ) : mixed
$document array | object The attributes that will be used to compose the entity.
$schema Mongolid\Schema\Schema Schema that will be used to map each field.
리턴 mixed

assembleDocumentsRecursively() 보호된 메소드

Assembly multiple documents for the given $schemaClass recursively.
protected assembleDocumentsRecursively ( mixed $value, string $schemaClass ) : mixed
$value mixed A value of an embeded field containing entity data to be assembled.
$schemaClass string The schemaClass to be used when assembling the entities within $value.
리턴 mixed

morphingTime() 보호된 메소드

Returns the return of polymorph method of the given entity if available.
또한 보기: Mongolid\Model\PolymorphableInterface::polymorph
또한 보기: https://i.ytimg.com/vi/TFGN9kAjdis/maxresdefault.jpg
protected morphingTime ( mixed $entity ) : mixed
$entity mixed The entity that may or may not have a polymorph method.
리턴 mixed The result of $entity->polymorph or the $entity itself.

prepareOriginalAttributes() 보호된 메소드

Stores original attributes from Entity if needed.
protected prepareOriginalAttributes ( mixed $entity ) : mixed
$entity mixed The entity that may have the attributes stored.
리턴 mixed The entity with original attributes.