PHP 클래스 VersionPress\Storages\MetaEntityStorage

The MetaEntityStorage typically transforms the entity to the format metioned above and then saves it using parent storage as a field of the parent entity.
상속: extends Storage
파일 보기 프로젝트 열기: versionpress/versionpress 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$keyName
$valueName

공개 메소드들

메소드 설명
__construct ( Storage $parentStorage, EntityInfo $entityInfo, $dbPrefix, $changeInfoFactory, $keyName = 'meta_key', $valueName = 'meta_value' )
commit ( )
delete ( $restriction )
exists ( $vpId, $parentId )
getEntityFilename ( $vpId, $parentId )
getPathCommonToAllEntities ( )
loadAll ( )
loadEntity ( $id, $parentId )
loadEntityByName ( $name, $parentId )
prepareStorage ( )
save ( $data )
saveLater ( $data )
shouldBeSaved ( $data )

보호된 메소드들

메소드 설명
createChangeInfoWithParentEntity ( $oldEntity, $newEntity, $oldParentEntity, $newParentEntity, $action )
createJoinedKey ( $key, $vpId ) : string Returns $key#$vpId from $key and $vpId inputs.
extractEntityFromParentByName ( $parentEntity, $name )
extractEntityFromParentByVpId ( $parentEntity, $vpId ) : array | null
splitJoinedKey ( $key ) : array Splits joined key $key#$vpId into array.

비공개 메소드들

메소드 설명
extractEntityFromParent ( $parentEntity, $joinedKey )
getJoinedKeyByName ( $parent, $name ) : string | null Finds a joined key with given VPID within the parent entity.
getJoinedKeyByVpId ( $parent, $vpId ) : string | null Finds a joined key with given VPID within the parent entity.
transformToParentEntityField ( $values )

메소드 상세

__construct() 공개 메소드

public __construct ( Storage $parentStorage, EntityInfo $entityInfo, $dbPrefix, $changeInfoFactory, $keyName = 'meta_key', $valueName = 'meta_value' )
$parentStorage Storage
$entityInfo VersionPress\Database\EntityInfo

commit() 공개 메소드

public commit ( )

createChangeInfoWithParentEntity() 보호된 메소드

protected createChangeInfoWithParentEntity ( $oldEntity, $newEntity, $oldParentEntity, $newParentEntity, $action )

createJoinedKey() 보호된 메소드

It's used in a parent entity file as key representing the entity.
protected createJoinedKey ( $key, $vpId ) : string
$key
$vpId
리턴 string

delete() 공개 메소드

public delete ( $restriction )

exists() 공개 메소드

public exists ( $vpId, $parentId )

extractEntityFromParentByName() 보호된 메소드

protected extractEntityFromParentByName ( $parentEntity, $name )

extractEntityFromParentByVpId() 보호된 메소드

protected extractEntityFromParentByVpId ( $parentEntity, $vpId ) : array | null
$parentEntity
$vpId
리턴 array | null

getEntityFilename() 공개 메소드

public getEntityFilename ( $vpId, $parentId )

getPathCommonToAllEntities() 공개 메소드

loadAll() 공개 메소드

public loadAll ( )

loadEntity() 공개 메소드

public loadEntity ( $id, $parentId )

loadEntityByName() 공개 메소드

public loadEntityByName ( $name, $parentId )

prepareStorage() 공개 메소드

public prepareStorage ( )

save() 공개 메소드

public save ( $data )

saveLater() 공개 메소드

public saveLater ( $data )

shouldBeSaved() 공개 메소드

public shouldBeSaved ( $data )

splitJoinedKey() 보호된 메소드

Example: Let the key name is "meta_key" and the input is "some-key#1234", then the output is array('meta_key' => 'some-key', 'vp_id' => '1234').
protected splitJoinedKey ( $key ) : array
$key
리턴 array

프로퍼티 상세

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

protected $keyName

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

protected $valueName