Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Api\EditEntity Class Reference

Derived class for API modules modifying a single entity identified by id xor a combination of site and page title. More...

+ Inheritance diagram for Wikibase\Repo\Api\EditEntity:
+ Collaboration diagram for Wikibase\Repo\Api\EditEntity:

Public Member Functions

 __construct (ApiMain $mainModule, $moduleName, ContentLanguages $termsLanguages, EntityRevisionLookup $revisionLookup, EntityIdParser $idParser, EntityFactory $entityFactory, Deserializer $statementDeserializer, array $propertyDataTypes, FingerprintChangeOpFactory $termChangeOpFactory, StatementChangeOpFactory $statementChangeOpFactory, SiteLinkChangeOpFactory $siteLinkChangeOpFactory, EntityChangeOpProvider $entityChangeOpProvider, EditSummaryHelper $editSummaryHelper, bool $federatedPropertiesEnabled)
 
 needsToken ()
 
 isWriteMode ()
 
- Public Member Functions inherited from Wikibase\Repo\Api\ModifyEntity
 __construct (ApiMain $mainModule, $moduleName, bool $federatedPropertiesEnabled, $modulePrefix='')
 
 setServices (SiteLinkTargetProvider $siteLinkTargetProvider)
 
 execute ()
 

Public Attributes

const PARAM_DATA = 'data'
 
const PARAM_CLEAR = 'clear'
 

Protected Member Functions

 prepareParameters (array $params)
 
 validateEntitySpecificParameters (array $preparedParameters, EntityDocument $entity, $baseRevId)
 
 modifyEntity (EntityDocument &$entity, ChangeOp $changeOp, array $preparedParameters)
 
 getChangeOp (array $preparedParameters, EntityDocument $entity)
 
 getAllowedParams ()
 
 getExamplesMessages ()
 
- Protected Member Functions inherited from Wikibase\Repo\Api\ModifyEntity
 getTitleLookup ()
 
 getResultBuilder ()
 
 createSummary (array $params)
 Create a new Summary instance suitable for representing the action performed by this module.
 
 applyChangeOp (ChangeOp $changeOp, EntityDocument $entity, Summary $summary=null)
 Applies the given ChangeOp to the given Entity.
 
 validateParameters (array $params)
 Make sure the required parameters are provided and that they are valid.
 

Private Member Functions

 entityExists (EntityId $entityId)
 
 getSummary (array $preparedParameters, EntityDocument $entity, ChangeOpResult $changeOpResult)
 
 isUpdatingExistingEntity (array $preparedParameters)
 
 buildResult (EntityDocument $entity)
 
 validateDataParameter (array $params)
 
 validateDataProperties ( $data, EntityDocument $entity, $revisionId=0)
 
 checkValidJson ( $data)
 
 checkPageIdProp (array $data, Title $title=null)
 
 checkNamespaceProp (array $data, Title $title=null)
 
 checkTitleProp (array $data, Title $title=null)
 
 checkRevisionProp (array $data, $revisionId)
 
 checkEntityId (array $data, EntityId $entityId=null)
 
 checkEntityType (array $data, EntityDocument $entity)
 
 assertArray ( $value, $message)
 
 assertString ( $value, $message)
 
 assertType ( $type, $value, $message)
 
 dieIfNotClearable (EntityDocument $entity)
 

Private Attributes

 $termsLanguages
 
 $termChangeOpFactory
 
 $statementChangeOpFactory
 
 $siteLinkChangeOpFactory
 
 $revisionLookup
 
 $statementDeserializer
 
 $idParser
 
 $entityFactory
 
 $propertyDataTypes
 
 $entityChangeOpProvider
 
 $editSummaryHelper
 

Additional Inherited Members

- Protected Attributes inherited from Wikibase\Repo\Api\ModifyEntity
 $stringNormalizer
 
 $siteLinkTargetProvider
 
 $siteLinkGroups
 
 $badgeItems
 
 $errorReporter
 
 $enabledEntityTypes
 

Detailed Description

Derived class for API modules modifying a single entity identified by id xor a combination of site and page title.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Api\EditEntity::__construct ( ApiMain  $mainModule,
  $moduleName,
ContentLanguages  $termsLanguages,
EntityRevisionLookup  $revisionLookup,
EntityIdParser  $idParser,
EntityFactory  $entityFactory,
Deserializer  $statementDeserializer,
array  $propertyDataTypes,
FingerprintChangeOpFactory  $termChangeOpFactory,
StatementChangeOpFactory  $statementChangeOpFactory,
SiteLinkChangeOpFactory  $siteLinkChangeOpFactory,
EntityChangeOpProvider  $entityChangeOpProvider,
EditSummaryHelper  $editSummaryHelper,
bool  $federatedPropertiesEnabled 
)
See also
ModifyEntity::__construct
Parameters
ApiMain$mainModule
string$moduleName
ContentLanguages$termsLanguages
EntityRevisionLookup$revisionLookup
EntityIdParser$idParser
EntityFactory$entityFactory
Deserializer$statementDeserializer
string[]$propertyDataTypes
FingerprintChangeOpFactory$termChangeOpFactory
StatementChangeOpFactory$statementChangeOpFactory
SiteLinkChangeOpFactory$siteLinkChangeOpFactory
EntityChangeOpProvider$entityChangeOpProvider
EditSummaryHelper$editSummaryHelper
bool$federatedPropertiesEnabled

Member Function Documentation

◆ assertArray()

Wikibase\Repo\Api\EditEntity::assertArray (   $value,
  $message 
)
private
Parameters
mixed$value
string$message

◆ assertString()

Wikibase\Repo\Api\EditEntity::assertString (   $value,
  $message 
)
private
Parameters
mixed$value
string$message

◆ assertType()

Wikibase\Repo\Api\EditEntity::assertType (   $type,
  $value,
  $message 
)
private
Parameters
string$type
mixed$value
string$message

◆ buildResult()

Wikibase\Repo\Api\EditEntity::buildResult ( EntityDocument  $entity)
private

◆ checkEntityId()

Wikibase\Repo\Api\EditEntity::checkEntityId ( array  $data,
EntityId  $entityId = null 
)
private
Parameters
array$data
EntityId | null$entityId

◆ checkEntityType()

Wikibase\Repo\Api\EditEntity::checkEntityType ( array  $data,
EntityDocument  $entity 
)
private
Parameters
array$data
EntityDocument$entity

◆ checkNamespaceProp()

Wikibase\Repo\Api\EditEntity::checkNamespaceProp ( array  $data,
Title  $title = null 
)
private
Parameters
array$data
Title | null$title

◆ checkPageIdProp()

Wikibase\Repo\Api\EditEntity::checkPageIdProp ( array  $data,
Title  $title = null 
)
private
Parameters
array$data
Title | null$title

◆ checkRevisionProp()

Wikibase\Repo\Api\EditEntity::checkRevisionProp ( array  $data,
  $revisionId 
)
private
Parameters
array$data
int | null$revisionId

◆ checkTitleProp()

Wikibase\Repo\Api\EditEntity::checkTitleProp ( array  $data,
Title  $title = null 
)
private
Parameters
array$data
Title | null$title

◆ checkValidJson()

Wikibase\Repo\Api\EditEntity::checkValidJson (   $data)
private
Parameters
mixed$data

◆ dieIfNotClearable()

Wikibase\Repo\Api\EditEntity::dieIfNotClearable ( EntityDocument  $entity)
private

◆ entityExists()

Wikibase\Repo\Api\EditEntity::entityExists ( EntityId  $entityId)
private
Parameters
EntityId$entityId
Returns
bool

◆ getAllowedParams()

Wikibase\Repo\Api\EditEntity::getAllowedParams ( )
protected

Reimplemented from Wikibase\Repo\Api\ModifyEntity.

◆ getChangeOp()

Wikibase\Repo\Api\EditEntity::getChangeOp ( array  $preparedParameters,
EntityDocument  $entity 
)
protected
Parameters
array$preparedParameters
EntityDocument$entity
Exceptions
ApiUsageException
Returns
ChangeOp

Reimplemented from Wikibase\Repo\Api\ModifyEntity.

◆ getExamplesMessages()

Wikibase\Repo\Api\EditEntity::getExamplesMessages ( )
protected

◆ getSummary()

Wikibase\Repo\Api\EditEntity::getSummary ( array  $preparedParameters,
EntityDocument  $entity,
ChangeOpResult  $changeOpResult 
)
private
Parameters
array$preparedParameters
EntityDocument$entity
ChangeOpResult$changeOpResult
Returns
Summary

◆ isUpdatingExistingEntity()

Wikibase\Repo\Api\EditEntity::isUpdatingExistingEntity ( array  $preparedParameters)
private

◆ isWriteMode()

Wikibase\Repo\Api\EditEntity::isWriteMode ( )
See also
ApiBase::isWriteMode()
Returns
bool Always true.

◆ modifyEntity()

Wikibase\Repo\Api\EditEntity::modifyEntity ( EntityDocument &  $entity,
ChangeOp  $changeOp,
array  $preparedParameters 
)
protected
See also
ModifyEntity::modifyEntity
Parameters
EntityDocument&$entity
ChangeOp$changeOp
array$preparedParameters
Returns
Summary

Reimplemented from Wikibase\Repo\Api\ModifyEntity.

◆ needsToken()

Wikibase\Repo\Api\EditEntity::needsToken ( )
See also
ApiBase::needsToken
Returns
string

◆ prepareParameters()

Wikibase\Repo\Api\EditEntity::prepareParameters ( array  $params)
protected
Parameters
array$params
Returns
array

Reimplemented from Wikibase\Repo\Api\ModifyEntity.

◆ validateDataParameter()

Wikibase\Repo\Api\EditEntity::validateDataParameter ( array  $params)
private
Parameters
array$params

◆ validateDataProperties()

Wikibase\Repo\Api\EditEntity::validateDataProperties (   $data,
EntityDocument  $entity,
  $revisionId = 0 
)
private
Parameters
mixed$data
EntityDocument$entity
int$revisionId

◆ validateEntitySpecificParameters()

Wikibase\Repo\Api\EditEntity::validateEntitySpecificParameters ( array  $preparedParameters,
EntityDocument  $entity,
  $baseRevId 
)
protected

Reimplemented from Wikibase\Repo\Api\ModifyEntity.

Member Data Documentation

◆ $editSummaryHelper

Wikibase\Repo\Api\EditEntity::$editSummaryHelper
private

◆ $entityChangeOpProvider

Wikibase\Repo\Api\EditEntity::$entityChangeOpProvider
private

◆ $entityFactory

Wikibase\Repo\Api\EditEntity::$entityFactory
private

◆ $idParser

Wikibase\Repo\Api\EditEntity::$idParser
private

◆ $propertyDataTypes

Wikibase\Repo\Api\EditEntity::$propertyDataTypes
private

◆ $revisionLookup

Wikibase\Repo\Api\EditEntity::$revisionLookup
private

◆ $siteLinkChangeOpFactory

Wikibase\Repo\Api\EditEntity::$siteLinkChangeOpFactory
private

◆ $statementChangeOpFactory

Wikibase\Repo\Api\EditEntity::$statementChangeOpFactory
private

◆ $statementDeserializer

Wikibase\Repo\Api\EditEntity::$statementDeserializer
private

◆ $termChangeOpFactory

Wikibase\Repo\Api\EditEntity::$termChangeOpFactory
private

◆ $termsLanguages

Wikibase\Repo\Api\EditEntity::$termsLanguages
private

◆ PARAM_CLEAR

const Wikibase\Repo\Api\EditEntity::PARAM_CLEAR = 'clear'

◆ PARAM_DATA

const Wikibase\Repo\Api\EditEntity::PARAM_DATA = 'data'

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