PHP 트레잇 yii2tech\balance\ManagerDataSerializeTrait

It may be useful using data storage with static data schema, like relational database. This trait supposed to be used inside descendant of Manager.
또한 보기: Manager
또한 보기: SerializerInterface
부터: 1.0
저자: Paul Klimov ([email protected])
파일 보기 프로젝트 열기: yii2tech/balance

공개 프로퍼티들

프로퍼티 타입 설명
$dataAttribute name of the transaction entity attribute, which should be used to store serialized data.

공개 메소드들

메소드 설명
getSerializer ( ) : yii2tech\balance\SerializerInterface
setSerializer ( yii2tech\balance\SerializerInterface | array | string $serializer )

보호된 메소드들

메소드 설명
createSerializer ( string | array $config ) : yii2tech\balance\SerializerInterface Creates serializer from given configuration.
serializeAttributes ( array $attributes, array $allowedAttributes ) : array Processes attributes to be saved in persistent storage, serializing the ones not allowed for direct storage.
unserializeAttributes ( array $attributes ) : array Processes the raw entity attributes from the persistent storage, converting serialized data into actual attributes list.

메소드 상세

createSerializer() 보호된 메소드

Creates serializer from given configuration.
protected createSerializer ( string | array $config ) : yii2tech\balance\SerializerInterface
$config string | array serializer configuration.
리턴 yii2tech\balance\SerializerInterface serializer instance

getSerializer() 공개 메소드

public getSerializer ( ) : yii2tech\balance\SerializerInterface
리턴 yii2tech\balance\SerializerInterface serializer instance

serializeAttributes() 보호된 메소드

Processes attributes to be saved in persistent storage, serializing the ones not allowed for direct storage.
protected serializeAttributes ( array $attributes, array $allowedAttributes ) : array
$attributes array raw attributes to be processed.
$allowedAttributes array list of attribute names, which are allowed to be saved in persistent stage.
리턴 array actual attributes.

setSerializer() 공개 메소드

public setSerializer ( yii2tech\balance\SerializerInterface | array | string $serializer )
$serializer yii2tech\balance\SerializerInterface | array | string serializer to be used

unserializeAttributes() 보호된 메소드

Processes the raw entity attributes from the persistent storage, converting serialized data into actual attributes list.
protected unserializeAttributes ( array $attributes ) : array
$attributes array raw attribute values from persistent storage.
리턴 array actual attribute values

프로퍼티 상세

$dataAttribute 공개적으로 프로퍼티

name of the transaction entity attribute, which should be used to store serialized data.
public $dataAttribute