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 ()
 
 getParserOutput (Title $title, $revisionId=null, ParserOptions $options=null, $generateHtml=true)
 Returns a ParserOutput object containing the HTML.
 
 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 ()
 
 prepareSave (WikiPage $page, $flags, $baseRevId, User $user)
 

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 prepareSave(), 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.
 
 getParserOutputFromEntityView ( $revisionId, ParserOptions $options, $generateHtml=true)
 
- Protected Member Functions inherited from Wikibase\Repo\Content\EntityContent
 getParserOutputForRedirect ( $generateHtml)
 
 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.

◆ getParserOutputFromEntityView()

Wikibase\Repo\Content\PropertyContent::getParserOutputFromEntityView (   $revisionId,
ParserOptions  $options,
  $generateHtml = true 
)
protected
Note
Will fail if this EntityContent represents a redirect.
Parameters
int | null$revisionId
ParserOptions$options
bool$generateHtml
Returns
ParserOutput

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()

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: