PHP 클래스 Bolt\Storage\Entity\Builder

파일 보기 프로젝트 열기: bolt/bolt 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$class string The class to use for new instances.
$classMetadata
$fieldManager
$metadata
$transformers

공개 메소드들

메소드 설명
__construct ( MetadataDriver $metadata, FieldManager $fieldManager ) Constructor.
create ( array | object $data, object | null $entity = null ) : object Creates a new entity object.
createFromDatabaseValues ( array $data, object | null $entity = null ) : object Performs database to PHP transforms before creating new entity.
getClassMetadata ( ) : Bolt\Storage\Mapping\ClassMetadata Gets the metadata instance.
getEntity ( object | null $entity = null ) : object Returns a new empty entity class.
getFields ( ) : array Uses either the class default or the supplied ClassMetadata to return a list of fields for this entity.
getHydratedValue ( $value, $field, null $subField = null ) : Bolt\Storage\Entity\FieldValue | boolean
refresh ( object | null $entity ) Refresh an entities values.
setClass ( string $class ) Sets the entity class that will be built.
setClassMetadata ( Bolt\Storage\Mapping\ClassMetadata $classMetadata ) Sets the metadata for the class to be built.
setTransformer ( string $fieldTypeClass, callable $handler ) Adds a transformer for a specific field type.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( MetadataDriver $metadata, FieldManager $fieldManager )
$metadata Bolt\Storage\Mapping\MetadataDriver
$fieldManager Bolt\Storage\FieldManager

create() 공개 메소드

Creates a new entity object.
public create ( array | object $data, object | null $entity = null ) : object
$data array | object Data to load into the entity.
$entity object | null
리턴 object $entity

createFromDatabaseValues() 공개 메소드

Performs database to PHP transforms before creating new entity.
public createFromDatabaseValues ( array $data, object | null $entity = null ) : object
$data array
$entity object | null
리턴 object $entity

getClassMetadata() 공개 메소드

Gets the metadata instance.
public getClassMetadata ( ) : Bolt\Storage\Mapping\ClassMetadata
리턴 Bolt\Storage\Mapping\ClassMetadata $classMetadata

getEntity() 공개 메소드

Returns a new empty entity class.
public getEntity ( object | null $entity = null ) : object
$entity object | null
리턴 object

getFields() 공개 메소드

Uses either the class default or the supplied ClassMetadata to return a list of fields for this entity.
public getFields ( ) : array
리턴 array

getHydratedValue() 공개 메소드

public getHydratedValue ( $value, $field, null $subField = null ) : Bolt\Storage\Entity\FieldValue | boolean
$value
$field
$subField null
리턴 Bolt\Storage\Entity\FieldValue | boolean

refresh() 공개 메소드

Refresh an entities values.
public refresh ( object | null $entity )
$entity object | null

setClass() 공개 메소드

Sets the entity class that will be built.
public setClass ( string $class )
$class string

setClassMetadata() 공개 메소드

Sets the metadata for the class to be built.
public setClassMetadata ( Bolt\Storage\Mapping\ClassMetadata $classMetadata )
$classMetadata Bolt\Storage\Mapping\ClassMetadata

setTransformer() 공개 메소드

Adds a transformer for a specific field type.
public setTransformer ( string $fieldTypeClass, callable $handler )
$fieldTypeClass string Class of the field type to transform
$handler callable

프로퍼티 상세

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

The class to use for new instances.
protected string $class
리턴 string

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

protected $classMetadata

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

protected $fieldManager

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

protected $metadata

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

protected $transformers