Property | Type | Description | |
---|---|---|---|
$ignoreFrequentlyWrittenEntities | boolean |
Property | Type | Description | |
---|---|---|---|
$entityInfo | |||
$isTransaction | boolean |
Method | Description | |
---|---|---|
__construct ( |
||
commit ( ) | Transfers data from memory (saved by Storage::saveLater()) to the files. | |
delete ( array $restriction ) : VersionPress\ChangeInfos\ChangeInfo | null | Deletes entity from a storage | |
exists ( string $id, string | null $parentId ) : boolean | Returns true if the entity exists. | |
getEntityFilename ( string $id, string | null $parentId ) : string | Returns a physical path to an INI file where the entity is stored | |
getPathCommonToAllEntities ( ) | ||
loadAll ( ) : array[] | Loads all entities managed by this storage | |
loadEntity ( string $id, string $parentId ) : array | Load an entity by given VPID | |
prepareStorage ( ) | Called from {@link VersionPress\Initialization\Initializer} to give storage a chance to prepare itself. | |
save ( array $data ) : VersionPress\ChangeInfos\ChangeInfo | null | Saves data to a storage | |
saveLater ( array $data ) | Saves data only in memory (used during initialization). | |
shouldBeSaved ( array $data ) : boolean | True / false if the entity should be saved / ignored. Works as a filtering method. |
Method | Description | |
---|---|---|
deserializeEntity ( $serializedEntity ) | ||
maybeReplacePlaceholderWithPrefix ( $key ) | ||
maybeReplacePrefixWithPlaceholder ( $key ) | ||
serializeEntity ( $vpid, $entity ) |
Method | Description | |
---|---|---|
flattenEntity ( $entity ) |
public __construct ( |
||
$entityInfo |
abstract public commit ( ) |
abstract public delete ( array $restriction ) : VersionPress\ChangeInfos\ChangeInfo | null | ||
$restriction | array | An array that typically contains a 'vp_id' key that specifies which entity to delete |
return | VersionPress\ChangeInfos\ChangeInfo | null | Null indicates that no actual delete happened (for example, the INI file for a given VPID didn't exist). Otherwise, the ChangeInfo object is returned (its action is usually 'delete'). |
abstract public loadAll ( ) : array[] | ||
return | array[] | Array of arrays where keys are VPIDs and values are arrays with entity data |
protected maybeReplacePlaceholderWithPrefix ( $key ) |
protected maybeReplacePrefixWithPlaceholder ( $key ) |
abstract public prepareStorage ( ) |
abstract public save ( array $data ) : VersionPress\ChangeInfos\ChangeInfo | null | ||
$data | array | Associative array with values to save. On `insert`, the $data will contain full entity data plus things like VPID. On further updates, the data will typically contain just the updated values and a VPID (assigned in {@link VersionPress\Database\WpdbMirrorBridge} so that the appropriate file could be located). |
return | VersionPress\ChangeInfos\ChangeInfo | null | Null indicates that the save operation didn't really change anything (may happen). Otherwise, the ChangeInfo object is returned. |
public shouldBeSaved ( array $data ) : boolean | ||
$data | array | |
return | boolean |
protected EntityInfo,VersionPress\Database $entityInfo | ||
return |
public bool $ignoreFrequentlyWrittenEntities | ||
return | boolean |