PHP Class VersionPress\Database\WpdbMirrorBridge

Especially, it transforms WP ids to VPIDs.
Exibir arquivo Open project: versionpress/versionpress

Public Methods

Method Description
__construct ( $database, Mirror $mirror, DbSchemaInfo $dbSchemaInfo, VpidRepository $vpidRepository, ShortcodesReplacer $shortcodesReplacer )
delete ( $table, $where, $parentIds )
disable ( ) Disables all actions. Useful for deactivating VersionPress.
getParentIdsBeforeDelete ( $table, $where ) : array Fill parentIds of child entities and returns them as associative array in $id => $parentId format.
insert ( $table, $data )
query ( ParsedQueryData $parsedQueryData )
update ( $table, $data, $where )

Private Methods

Method Description
createEntity ( $table, $data )
createReference ( $referenceDetails, $data )
deleteEntity ( $table, $where, $parentIds )
deleteReference ( $referenceDetails, $where )
detectAllAffectedIds ( $entityName, $data, $where ) : array Returns all database IDs matching the restriction.
fillParentId ( $metaEntityName, $entityInfo, $id )
getIdsForRestriction ( string $entityName, array $where ) : array Returns all ids from DB suitable for given restriction.
processDeleteQuery ( ParsedQueryData $parsedQueryData ) Process ParsedQueryData from DELETE query and deletes entity/entities data from Storage.
processInsertQuery ( ParsedQueryData $parsedQueryData ) Process ParsedQueryData from INSERT query and stores affected entity into Storage.
processInsertUpdateQuery ( ParsedQueryData $parsedQueryData ) Processes ParsedQueryData from INSERT .
processUpdateQuery ( ParsedQueryData $parsedQueryData ) Processes ParsedQueryData from UPDATE query and stores updated entity/entities data into Storage.
storeRelatedEntities ( array $data, string $entityName ) Saves all already existing meta and M:N references for an entity that wasn't tracked yet
updateEntity ( $data, $entityName, $id )

Method Details

__construct() public method

public __construct ( $database, Mirror $mirror, DbSchemaInfo $dbSchemaInfo, VpidRepository $vpidRepository, ShortcodesReplacer $shortcodesReplacer )
$mirror VersionPress\Storages\Mirror
$dbSchemaInfo DbSchemaInfo
$vpidRepository VpidRepository
$shortcodesReplacer ShortcodesReplacer

delete() public method

public delete ( $table, $where, $parentIds )

disable() public method

Disables all actions. Useful for deactivating VersionPress.
public disable ( )

getParentIdsBeforeDelete() public method

Returns FALSE when table contains entity which is not an childEntity.
public getParentIdsBeforeDelete ( $table, $where ) : array
$table
$where
return array

insert() public method

public insert ( $table, $data )

query() public method

public query ( ParsedQueryData $parsedQueryData )
$parsedQueryData ParsedQueryData

update() public method

public update ( $table, $data, $where )