Semantic MediaWiki and related extensions
Public Member Functions | List of all members
SMW\SQLStore\EntityStore\IdChanger Class Reference

Public Member Functions

 __construct (SQLStore $store, JobFactory $jobFactory=null)
 
 move ( $curid, $targetid=0)
 
 change ( $old_id, $new_id, $old_ns=-1, $new_ns=-1, $s_data=true, $po_data=true)
 

Detailed Description

GNU GPL v2+

Since
3.0
Author
mwjames

Constructor & Destructor Documentation

◆ __construct()

SMW\SQLStore\EntityStore\IdChanger::__construct ( SQLStore  $store,
JobFactory  $jobFactory = null 
)
Since
3.0
Parameters
SQLStore$store
JobFactory | null$jobFactory

Member Function Documentation

◆ change()

SMW\SQLStore\EntityStore\IdChanger::change (   $old_id,
  $new_id,
  $old_ns = -1,
  $new_ns = -1,
  $s_data = true,
  $po_data = true 
)

Change an SMW page id across all relevant tables. The redirect table is also updated (without much effect if the change happended due to some redirect, since the table should not contain the id of the redirected page). If namespaces are given, then they are used to delete any entries that are limited to one particular namespace (e.g. only properties can be used as properties) instead of moving them.

The id in the SMW IDs table is not touched.

Note
This method only changes internal page IDs in SMW. It does not assume any change in (title-related) data, as e.g. in a page move. Internal objects (subobject) do not need to be updated since they refer to the title of their parent page, not to its ID.
Since
1.8
Parameters
integer$old_idnumeric ID that is to be changed
integer$new_idnumeric ID to which the records are to be changed
integer$old_nsnamespace of old id's page (-1 to ignore it)
integer$new_nsnamespace of new id's page (-1 to ignore it)
boolean$s_datastating whether to update subject references
boolean$po_datastating if to update property/object references

◆ move()

SMW\SQLStore\EntityStore\IdChanger::move (   $curid,
  $targetid = 0 
)

Change an internal id to another value. If no target value is given, the value is changed to become the last id entry (based on the automatic id increment of the database). Whatever currently occupies this id will be moved consistently in all relevant tables. Whatever currently occupies the target id will be ignored (it should be ensured that nothing is moved to an id that is still in use somewhere).

Since
3.1
Parameters
integer$curid
integer$targetid
Returns

The documentation for this class was generated from the following file:

About | General disclaimer | Privacy policy