PHP Class VersionPress\Database\VpidRepository

Mostrar archivo Open project: versionpress/versionpress Class Usage Examples

Public Methods

Method Description
__construct ( $database, DbSchemaInfo $schemaInfo )
deleteId ( $entityName, $id )
getIdForVpid ( $vpid )
getMenuReference ( $postmeta ) : null | string Function used in schema.yml.
getVpidForEntity ( $entityName, $id ) : null | string Returns VPID of entity of given type and id.
identifyEntity ( $entityName, $data, $id )
replaceForeignKeysWithReferences ( $entityName, $entity )
restoreForeignKeys ( $entityName, $entity )

Private Methods

Method Description
fillId ( $entityName, $data, $id )
isNullReference ( $id )
replaceIdsInString ( $targetEntity, $stringWithIds )
restoreIdsInString ( $stringWithVpids )
saveId ( $entityName, $id, $vpId )

Method Details

__construct() public method

public __construct ( $database, DbSchemaInfo $schemaInfo )
$schemaInfo DbSchemaInfo

deleteId() public method

public deleteId ( $entityName, $id )

getIdForVpid() public method

public getIdForVpid ( $vpid )

getMenuReference() public static method

Maps menu item with given postmeta (_menu_item_object_id) to target entity (post/category/custom url).
public static getMenuReference ( $postmeta ) : null | string
$postmeta
return null | string

getVpidForEntity() public method

Returns VPID of entity of given type and id.
public getVpidForEntity ( $entityName, $id ) : null | string
$entityName
$id
return null | string

identifyEntity() public method

public identifyEntity ( $entityName, $data, $id )

replaceForeignKeysWithReferences() public method

public replaceForeignKeysWithReferences ( $entityName, $entity )

restoreForeignKeys() public method

public restoreForeignKeys ( $entityName, $entity )