Ordered and non-unique collection of Statement objects.
More...
Ordered and non-unique collection of Statement objects.
Provides various filter operations.
Does not do any indexing by default. Does not provide complex modification functionality.
- Since
- 1.0
- Copyright
- GPL-2.0-or-later
- 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 >
-
Thiemo Kreuz
◆ __construct()
Wikibase\DataModel\Statement\StatementList::__construct |
( |
Statement ... | $statements | ) |
|
◆ __clone()
Wikibase\DataModel\Statement\StatementList::__clone |
( |
| ) |
|
◆ addNewStatement()
Wikibase\DataModel\Statement\StatementList::addNewStatement |
( |
Snak | $mainSnak, |
|
|
| $qualifiers = null, |
|
|
| $references = null, |
|
|
string | $guid = null ) |
- Parameters
-
Snak | $mainSnak | |
Snak[] | SnakList | null | $qualifiers | |
Reference[] | ReferenceList | null | $references | |
string | null | $guid | |
◆ addStatement()
Wikibase\DataModel\Statement\StatementList::addStatement |
( |
Statement | $statement, |
|
|
int | $index = null ) |
- See also
- ReferenceList::addReference
- Since
- 1.0, setting an index is supported since 6.1
- Parameters
-
Statement | $statement | |
int | null | $index | New position of the added statement, or null to append. |
- Exceptions
-
◆ clear()
Wikibase\DataModel\Statement\StatementList::clear |
( |
| ) |
|
Removes all statements from this list.
- Since
- 7.0
◆ count()
Wikibase\DataModel\Statement\StatementList::count |
( |
| ) |
|
- See also
- Countable::count
- Returns
- int
◆ equals()
Wikibase\DataModel\Statement\StatementList::equals |
( |
| $target | ) |
|
◆ filter()
Wikibase\DataModel\Statement\StatementList::filter |
( |
StatementFilter | $filter | ) |
|
- Since
- 4.1
- Parameters
-
- Returns
- self
◆ getAllSnaks()
Wikibase\DataModel\Statement\StatementList::getAllSnaks |
( |
| ) |
|
Returns a list of all Snaks on this StatementList.
This includes at least the main snaks of all statements, the snaks from qualifiers, and the snaks from references.
This is a convenience method for use in code that needs to operate on all snaks, e.g. to find all referenced Entities.
- Since
- 1.1
- Returns
- Snak[] Numerically indexed (non-sparse) array.
◆ getBestStatements()
Wikibase\DataModel\Statement\StatementList::getBestStatements |
( |
| ) |
|
Returns the so called "best statements".
If there are preferred statements, then this is all the preferred statements. If there are no preferred statements, then this is all normal statements.
- Since
- 2.4
- Returns
- self
◆ getByPropertyId()
Wikibase\DataModel\Statement\StatementList::getByPropertyId |
( |
PropertyId | $id | ) |
|
- Since
- 3.0
- Parameters
-
- Returns
- self
◆ getByRank()
Wikibase\DataModel\Statement\StatementList::getByRank |
( |
| $acceptableRanks | ) |
|
- Since
- 3.0
- Parameters
-
int | int[] | $acceptableRanks | |
- Returns
- self
◆ getFirstStatementWithGuid()
Wikibase\DataModel\Statement\StatementList::getFirstStatementWithGuid |
( |
?string | $statementGuid | ) |
|
- See also
- StatementByGuidMap
- Since
- 3.0
- Parameters
-
string | null | $statementGuid | |
- Returns
- Statement|null The first statement with the given GUID or null if not found.
◆ getIndexOfFirstStatementWithGuid()
Wikibase\DataModel\Statement\StatementList::getIndexOfFirstStatementWithGuid |
( |
?string | $statementGuid | ) |
|
|
private |
- Parameters
-
string | null | $statementGuid | |
- Returns
- int|null The index of the first statement with the given GUID or null if not found.
◆ getIterator()
Wikibase\DataModel\Statement\StatementList::getIterator |
( |
| ) |
|
- Returns
- Iterator|Statement[]
◆ getMainSnaks()
Wikibase\DataModel\Statement\StatementList::getMainSnaks |
( |
| ) |
|
- Since
- 2.3
- Returns
- Snak[] Numerically indexed (non-sparse) array.
◆ getPropertyIds()
Wikibase\DataModel\Statement\StatementList::getPropertyIds |
( |
| ) |
|
Returns the property ids used by the statements.
The keys of the returned array hold the serializations of the property ids.
- Returns
- PropertyId[] Array indexed by property id serialization.
◆ getWithUniqueMainSnaks()
Wikibase\DataModel\Statement\StatementList::getWithUniqueMainSnaks |
( |
| ) |
|
Statements that have a main snak already in the list are filtered out.
The last occurrences are retained.
- Since
- 1.0
- Returns
- self
◆ isEmpty()
Wikibase\DataModel\Statement\StatementList::isEmpty |
( |
| ) |
|
◆ removeStatementsWithGuid()
Wikibase\DataModel\Statement\StatementList::removeStatementsWithGuid |
( |
?string | $guid | ) |
|
◆ replaceStatement()
Wikibase\DataModel\Statement\StatementList::replaceStatement |
( |
StatementGuid | $statementGuid, |
|
|
Statement | $newStatement ) |
- Parameters
-
StatementGuid | $statementGuid | The GUID of the Statement to be replaced |
Statement | $newStatement | The new Statement |
- Exceptions
-
StatementNotFoundException | if the Statement with $statementGuid can't be found |
StatementGuidChangedException | if the $newStatement has a different StatementGuid |
PropertyChangedException | if the $newStatement has a different MainSnak Property |
◆ statementsEqual()
Wikibase\DataModel\Statement\StatementList::statementsEqual |
( |
array | $statements | ) |
|
|
private |
◆ toArray()
Wikibase\DataModel\Statement\StatementList::toArray |
( |
| ) |
|
- Returns
- Statement[] Numerically indexed (non-sparse) array.
◆ $statements
Wikibase\DataModel\Statement\StatementList::$statements |
|
private |
The documentation for this class was generated from the following file: