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
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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