PHP Class VersionPress\Storages\Mirror

Show file Open project: versionpress/versionpress Class Usage Examples

Public Methods

Method Description
__construct ( StorageFactory $storageFactory, AbsoluteUrlReplacer $urlReplacer )
delete ( string $entityName, array $restriction ) Chooses an appropriate storage and calls its {@see VersionPress\Storages\Storage::delete() delete()} method.
flushChangeList ( ) Dumps a list of {@see VersionPress\ChangeInfos\ChangeInfo} objects captured by this mirror.
getChangeList ( ) : TrackedChangeInfo[] Contains a list of {@see VersionPress\ChangeInfos\ChangeInfo} objects captured by this mirror.
save ( string $entityName, array $data ) Chooses an appropriate storage and calls its {@see VersionPress\Storages\Storage::save() save()} method.
shouldBeSaved ( string $entityName, array $data ) : boolean Queries the associated storage whether the entity data should be saved or not

Method Details

__construct() public method

public __construct ( StorageFactory $storageFactory, AbsoluteUrlReplacer $urlReplacer )
$storageFactory StorageFactory
$urlReplacer VersionPress\Utils\AbsoluteUrlReplacer

delete() public method

Chooses an appropriate storage and calls its {@see VersionPress\Storages\Storage::delete() delete()} method.
See also: Storage::delete()
public delete ( string $entityName, array $restriction )
$entityName string Entity type determines the storage used
$restriction array Restriction passed to the `VersionPress\Storages\Storage::delete()` method

flushChangeList() public method

Capturing new changes starts again from this point.
public flushChangeList ( )

getChangeList() public method

Can be an empty array if there was no real change in any of the storages.
public getChangeList ( ) : TrackedChangeInfo[]
return VersionPress\ChangeInfos\TrackedChangeInfo[]

save() public method

Chooses an appropriate storage and calls its {@see VersionPress\Storages\Storage::save() save()} method.
See also: Storage::save()
public save ( string $entityName, array $data )
$entityName string Entity type determines the storage used
$data array Data passed to the `VersionPress\Storages\Storage::save()` method

shouldBeSaved() public method

Queries the associated storage whether the entity data should be saved or not
See also: Storage::shouldBeSaved()
public shouldBeSaved ( string $entityName, array $data ) : boolean
$entityName string Determines the storage
$data array Data passed to VersionPress\Storages\Storage::shouldBeSaved()
return boolean