Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Content\PropertyContent Class Reference

Content object for articles representing Wikibase properties. More...

+ Inheritance diagram for Wikibase\Repo\Content\PropertyContent:
+ Collaboration diagram for Wikibase\Repo\Content\PropertyContent:

Public Member Functions

 __construct (EntityHolder $propertyHolder=null)
 Do not use to construct new stuff from outside of this class, use the static newFoobar methods.
 
 getProperty ()
 
 getEntity ()
 
 getEntityHolder ()
 
 getEntityPageProperties ()
 
 isValid ()
 Checks if this PropertyContent is valid for saving.
 
 isEmpty ()
 
- Public Member Functions inherited from Wikibase\Repo\Content\EntityContent
 isCountable ( $hasLinks=null)
 
 getEntityRedirect ()
 Returns the EntityRedirect represented by this EntityContent, or null if this EntityContent is not a redirect.
 
 getEntityId ()
 
 getTextForSearchIndex ()
 
 getTextForFilters ()
 
 getWikitextForTransclusion ()
 
 getTextForSummary ( $maxLength=250)
 Returns a textual representation of the content suitable for use in edit summaries and log messages.
 
 getNativeData ()
 
 getSize ()
 returns the content's nominal size in bogo-bytes.
 
 equals (Content $that=null)
 Both contents will be considered equal if they have the same ID and equal Entity data.
 
 getDiff (EntityContent $toContent)
 Returns a diff between this EntityContent and the given EntityContent.
 
 getPatchedCopy (EntityContentDiff $patch)
 Returns a patched copy of this Content object.
 
 copy ()
 

Static Public Member Functions

static newFromProperty (Property $property)
 Create a new propertyContent object for the provided property.
 

Public Attributes

const CONTENT_MODEL_ID = 'wikibase-property'
 
- Public Attributes inherited from Wikibase\Repo\Content\EntityContent
const EDIT_IGNORE_CONSTRAINTS = 1024
 Flag for use with EntityHandler::validateSave(), indicating that no pre-save validation should be applied.
 

Protected Member Functions

 getIgnoreKeysForFilters ()
 Get the keys within this Contents Entity JSON that should be removed for text passed to edit filters.
 
- Protected Member Functions inherited from Wikibase\Repo\Content\EntityContent
 getRedirectText ()
 

Private Attributes

 $propertyHolder
 

Detailed Description

Content object for articles representing Wikibase properties.

Author
Jeroen De Dauw < jeroe.nosp@m.nded.nosp@m.auw@g.nosp@m.mail.nosp@m..com >
Bene* < benes.nosp@m.tar..nosp@m.wikim.nosp@m.edia.nosp@m.@gmai.nosp@m.l.co.nosp@m.m >

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Content\PropertyContent::__construct ( EntityHolder $propertyHolder = null)

Do not use to construct new stuff from outside of this class, use the static newFoobar methods.

In other words: treat as protected (which it was, but now cannot be since we derive from Content).

Access:\n protected
Parameters
EntityHolder | null$propertyHolder
Exceptions
InvalidArgumentException

Member Function Documentation

◆ getEntity()

Wikibase\Repo\Content\PropertyContent::getEntity ( )
See also
EntityContent::getEntity
Exceptions
LogicExceptionif the content object is empty and does not contain an entity.
Returns
Property

Reimplemented from Wikibase\Repo\Content\EntityContent.

◆ getEntityHolder()

Wikibase\Repo\Content\PropertyContent::getEntityHolder ( )
See also
EntityContent::getEntityHolder
Returns
EntityHolder|null

Reimplemented from Wikibase\Repo\Content\EntityContent.

◆ getEntityPageProperties()

Wikibase\Repo\Content\PropertyContent::getEntityPageProperties ( )
See also
EntityContent::getEntityPageProperties

Records the number of statements in the 'wb-claims' key.

Returns
array A map from property names to property values.

Reimplemented from Wikibase\Repo\Content\EntityContent.

◆ getIgnoreKeysForFilters()

Wikibase\Repo\Content\PropertyContent::getIgnoreKeysForFilters ( )
protected

Get the keys within this Contents Entity JSON that should be removed for text passed to edit filters.

Returns
string[] Keys to ignore

Reimplemented from Wikibase\Repo\Content\EntityContent.

◆ getProperty()

Wikibase\Repo\Content\PropertyContent::getProperty ( )
Exceptions
LogicExceptionif the content object is empty and does not contain an entity.
Returns
Property

◆ isEmpty()

Wikibase\Repo\Content\PropertyContent::isEmpty ( )
See also
EntityContent::isEmpty
Returns
bool True if this is not a redirect and the item is empty.

Reimplemented from Wikibase\Repo\Content\EntityContent.

◆ isValid()

Wikibase\Repo\Content\PropertyContent::isValid ( )

Checks if this PropertyContent is valid for saving.

Returns false if the entity does not have a DataType set.

See also
Content::isValid()
Returns
bool True if this content object is valid for saving. False if there is no entity, or the entity does not have an ID set.

Reimplemented from Wikibase\Repo\Content\EntityContent.

◆ newFromProperty()

static Wikibase\Repo\Content\PropertyContent::newFromProperty ( Property $property)
static

Create a new propertyContent object for the provided property.

Parameters
Property$property
Returns
self

Member Data Documentation

◆ $propertyHolder

Wikibase\Repo\Content\PropertyContent::$propertyHolder
private

◆ CONTENT_MODEL_ID

const Wikibase\Repo\Content\PropertyContent::CONTENT_MODEL_ID = 'wikibase-property'

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