PHP 클래스 Bolt\Storage\Field\Type\FieldTypeBase

저자: Ross Riley ([email protected])
상속: implements Bolt\Storage\Field\Type\FieldTypeInterface, implements Bolt\Storage\Field\FieldInterface, use trait Bolt\Storage\CaseTransformTrait
파일 보기 프로젝트 열기: bolt/bolt 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$mapping

보호된 프로퍼티들

프로퍼티 타입 설명
$em
$platform

공개 메소드들

메소드 설명
__construct ( array $mapping = [], EntityManager $em = null )
get ( $entity ) : mixed Reads the current value of the field from an entity and returns value
getMappingAttribute ( ) : string Gets the entity attribute name to be used for reading / persisting
getName ( )
getPlatform ( ) : Doctrine\DBAL\Platforms\AbstractPlatform Returns the platform
getStorageOptions ( )
getStorageType ( ) : Doctrine\DBAL\Types\Type Returns the name of the Doctrine storage type to use for a field.
getTemplate ( ) Provides a template that is able to render the field
hydrate ( $data, $entity )
load ( Doctrine\DBAL\Query\QueryBuilder $query, Bolt\Storage\Mapping\ClassMetadata $metadata )
persist ( Bolt\Storage\QuerySet $queries, $entity )
present ( $entity )
query ( Bolt\Storage\Query\QueryInterface $query, Bolt\Storage\Mapping\ClassMetadata $metadata )
set ( object $entity, mixed $value ) The set method takes a raw php value and performs the conversion to the entity value.
setPlatform ( Doctrine\DBAL\Platforms\AbstractPlatform $platform ) Sets the current platform to an instance of AbstractPlatform

보호된 메소드들

메소드 설명
isJson ( mixed $value ) : boolean Check if a value is a JSON string.
normalizeData ( $data, $field )
rewriteQueryFilterParameters ( Filter $filter, Bolt\Storage\Query\QueryInterface $query, $field, $column ) This method does an in-place modification of a generic contenttype.field query to the format actually used in the raw sql category. For instance a simple query might say entries.tags = 'movies' but now we are in the context of entries the actual SQL fragment needs to be tags.slug = 'movies'. We don't know this until we drill down to the individual field types so this rewrites the SQL fragment just before the query gets sent.

메소드 상세

__construct() 공개 메소드

public __construct ( array $mapping = [], EntityManager $em = null )
$mapping array
$em Bolt\Storage\EntityManager

get() 공개 메소드

Reads the current value of the field from an entity and returns value
public get ( $entity ) : mixed
$entity
리턴 mixed

getMappingAttribute() 공개 메소드

Gets the entity attribute name to be used for reading / persisting
public getMappingAttribute ( ) : string
리턴 string

getName() 공개 메소드

public getName ( )

getPlatform() 공개 메소드

Returns the platform
public getPlatform ( ) : Doctrine\DBAL\Platforms\AbstractPlatform
리턴 Doctrine\DBAL\Platforms\AbstractPlatform

getStorageOptions() 공개 메소드

사용 중단: Here to maintain compatibility with the old interface
public getStorageOptions ( )

getStorageType() 공개 메소드

Returns the name of the Doctrine storage type to use for a field.
public getStorageType ( ) : Doctrine\DBAL\Types\Type
리턴 Doctrine\DBAL\Types\Type

getTemplate() 공개 메소드

Provides a template that is able to render the field
사용 중단:
public getTemplate ( )

hydrate() 공개 메소드

public hydrate ( $data, $entity )

isJson() 보호된 메소드

Check if a value is a JSON string.
protected isJson ( mixed $value ) : boolean
$value mixed
리턴 boolean

load() 공개 메소드

public load ( Doctrine\DBAL\Query\QueryBuilder $query, Bolt\Storage\Mapping\ClassMetadata $metadata )
$query Doctrine\DBAL\Query\QueryBuilder
$metadata Bolt\Storage\Mapping\ClassMetadata

normalizeData() 보호된 메소드

protected normalizeData ( $data, $field )

persist() 공개 메소드

public persist ( Bolt\Storage\QuerySet $queries, $entity )
$queries Bolt\Storage\QuerySet

present() 공개 메소드

public present ( $entity )

query() 공개 메소드

public query ( Bolt\Storage\Query\QueryInterface $query, Bolt\Storage\Mapping\ClassMetadata $metadata )
$query Bolt\Storage\Query\QueryInterface
$metadata Bolt\Storage\Mapping\ClassMetadata

rewriteQueryFilterParameters() 보호된 메소드

Note, reflection is used to achieve this, it is not ideal, but the CompositeExpression shipped with DBAL chooses to keep the query parts as private and only allow access to the final computed string.
protected rewriteQueryFilterParameters ( Filter $filter, Bolt\Storage\Query\QueryInterface $query, $field, $column )
$filter Bolt\Storage\Query\Filter
$query Bolt\Storage\Query\QueryInterface
$field
$column

set() 공개 메소드

Normally this is as simple as $entity->$key = $value although more complicated transforms can happen should a field type choose to override this method. Note too that this will also be the default method called for an entity builder which is designed to receive raw data to initialise an entity.
public set ( object $entity, mixed $value )
$entity object
$value mixed

setPlatform() 공개 메소드

Sets the current platform to an instance of AbstractPlatform
public setPlatform ( Doctrine\DBAL\Platforms\AbstractPlatform $platform )
$platform Doctrine\DBAL\Platforms\AbstractPlatform

프로퍼티 상세

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

protected $em

$mapping 공개적으로 프로퍼티

public $mapping

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

protected $platform