Semantic MediaWiki and related extensions
Public Member Functions | Static Public Member Functions | List of all members
SWLChangeSet Class Reference

Public Member Functions

 __construct (SMWDIWikiPage $subject, $changes=null, $insertions=null, $deletions=null, $id=null, $edit=null)
 
 hasUserDefinedProperties ()
 
 hasChanges ()
 
 getInsertions ()
 
 getDeletions ()
 
 getChanges ()
 
 getSubject ()
 
 addChange (SMWDIProperty $property, SWLPropertyChange $change)
 
 addInsertion (SMWDIProperty $property, SMWDataItem $dataItem)
 
 addDeletion (SMWDIProperty $property, SMWDataItem $dataItem)
 
 getAllProperties ()
 
 removeChangesForProperty (SMWDIProperty $property)
 
 getAllPropertyChanges (SMWDIProperty $property)
 
 toArray ()
 
 writeToStore (array $groupsToAssociate, $editId)
 
 getTitle ()
 
 getEdit ()
 
 setEdit (SWLEdit $edit)
 
 hasInsertion (SMWDIProperty $property, $value)
 
 hasDeletion (SMWDIProperty $property, $value)
 
 hasChange (SMWDIProperty $property, SWLPropertyChange $change)
 
 mergeInChangeSet (SWLChangeSet $set)
 

Static Public Member Functions

static newFromDBResult ( $set)
 
static newFromArray (array $changeSetArray)
 
static newFromSemanticData (SMWSemanticData $old, SMWSemanticData $new, array $filterProperties=null)
 

Constructor & Destructor Documentation

◆ __construct()

SWLChangeSet::__construct ( SMWDIWikiPage  $subject,
  $changes = null,
  $insertions = null,
  $deletions = null,
  $id = null,
  $edit = null 
)

Create a new instance of a change set.

Parameters
SMWDIWikiPage$subject
SWLPropertyChanges$changesCan be null
SMWSemanticData$insertionsCan be null
SMWSemanticData$deletionsCan be null
integer$idCan be null
SWLEdit$editCan be null

Member Function Documentation

◆ addChange()

SWLChangeSet::addChange ( SMWDIProperty  $property,
SWLPropertyChange  $change 
)

Adds a SWLPropertyChange to the set for the specified SMWDIProperty.

Since
0.1
Parameters
SMWDIProperty$property
SWLPropertyChange$change

◆ addDeletion()

SWLChangeSet::addDeletion ( SMWDIProperty  $property,
SMWDataItem  $dataItem 
)

Adds a SMWDataItem representing a deletion to the set for the specified SMWDIProperty.

Since
0.1
Parameters
SMWDIProperty$property
SMWDataItem$dataItem

◆ addInsertion()

SWLChangeSet::addInsertion ( SMWDIProperty  $property,
SMWDataItem  $dataItem 
)

Adds a SMWDataItem representing an insertion to the set for the specified SMWDIProperty.

Since
0.1
Parameters
SMWDIProperty$property
SMWDataItem$dataItem

◆ getAllProperties()

SWLChangeSet::getAllProperties ( )

Returns a list of all properties.

Returns
array of SMWDIProperty

◆ getAllPropertyChanges()

SWLChangeSet::getAllPropertyChanges ( SMWDIProperty  $property)

Returns a list of ALL changes, including isertions and deletions.

Parameters
SMWDIProperty$proprety
Returns
array of SWLPropertyChange

◆ getChanges()

SWLChangeSet::getChanges ( )

Returns a SWLPropertyChanges object holding all SWLPropertyChange objects.

Returns
SWLPropertyChanges

◆ getDeletions()

SWLChangeSet::getDeletions ( )

Returns a SMWSemanticData object holding all deleted SMWDataItem objects.

Returns
SMWSemanticData

◆ getEdit()

SWLChangeSet::getEdit ( )

Gets the edit this set of changes belong to.

Since
0.1
Returns
SWLEdit

◆ getInsertions()

SWLChangeSet::getInsertions ( )

Returns a SMWSemanticData object holding all inserted SMWDataItem objects.

Returns
SMWSemanticData

◆ getSubject()

SWLChangeSet::getSubject ( )

Returns the subject these changes apply to.

Returns
SMWDIWikiPage

◆ getTitle()

SWLChangeSet::getTitle ( )

Gets the title of the page these changes belong to.

Since
0.1
Returns
Title

◆ hasChange()

SWLChangeSet::hasChange ( SMWDIProperty  $property,
SWLPropertyChange  $change 
)

Returns if a certain change is present in the set of changes.

Since
0.1
Parameters
SMWDIProperty$property
SWLPropertyChange$change
Returns
boolean

◆ hasChanges()

SWLChangeSet::hasChanges ( )

Returns whether the set contains any changes.

Since
0.1
Returns
boolean

◆ hasDeletion()

SWLChangeSet::hasDeletion ( SMWDIProperty  $property,
  $value 
)

Returns if a certain insertion is present in the set of changes.

Since
0.1
Parameters
SMWDIProperty$property
string$value
Returns
boolean

◆ hasInsertion()

SWLChangeSet::hasInsertion ( SMWDIProperty  $property,
  $value 
)

Returns if a certain insertion is present in the set of changes.

Since
0.1
Parameters
SMWDIProperty$property
string$value
Returns
boolean

◆ hasUserDefinedProperties()

SWLChangeSet::hasUserDefinedProperties ( )

Rteurns if the change set contains (changes for) user defined properties.

Since
0.1
Returns
boolean

◆ mergeInChangeSet()

SWLChangeSet::mergeInChangeSet ( SWLChangeSet  $set)

Merges in the changes of another change set. Duplicate changes are detected and only kept as a single change. This is usefull for merging sets with (possibly overlapping) changes belonging to a single edit.

Since
0.1
Parameters
SWLChangeSet$set

◆ newFromArray()

static SWLChangeSet::newFromArray ( array  $changeSetArray)
static

Creates and returns a new SWLChangeSet instance from a database result obtained by doing a select on swl_sets.

Since
0.1
Parameters
array$changeSetArray
Returns
SWLChangeSet

◆ newFromDBResult()

static SWLChangeSet::newFromDBResult (   $set)
static

Creates and returns a new SWLChangeSet instance from a database result obtained by doing a select on swl_sets.

Since
0.1
Parameters
$set
Returns
SWLChangeSet

◆ newFromSemanticData()

static SWLChangeSet::newFromSemanticData ( SMWSemanticData  $old,
SMWSemanticData  $new,
array  $filterProperties = null 
)
static

Creates and returns a new SMWChangeSet from 2 SMWSemanticData objects.

Parameters
SMWSemanticData$old
SMWSemanticData$new
array$filterPropertiesOptional list of properties (string serializations) to filter on. Null for no filtering.
Returns
SMWChangeSet

◆ removeChangesForProperty()

SWLChangeSet::removeChangesForProperty ( SMWDIProperty  $property)

Removes all changes for a certian property.

Parameters
SMWDIProperty$property

◆ setEdit()

SWLChangeSet::setEdit ( SWLEdit  $edit)

Sets the edit this set of changes belong to.

Since
0.1
Parameters
SWLEdit$edit

◆ toArray()

SWLChangeSet::toArray ( )

Serializes the object as an associative array, which can be passed to newFromArray to create a new instance.

Since
0.1
Returns
array

◆ writeToStore()

SWLChangeSet::writeToStore ( array  $groupsToAssociate,
  $editId 
)

Save the change set to the database.

Since
0.1
Parameters
arrayof SWLGroup
integer$editId
Returns
integer ID of the inserted row (0 if nothing was inserted).

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

About | General disclaimer | Privacy policy