List of Reference objects.
More...
List of Reference objects.
- Since
- 0.1 Does not implement References anymore since 2.0 Does not extend SplObjectStorage since 5.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 >
-
H. Snater < media.nosp@m.wiki.nosp@m.@snat.nosp@m.er.c.nosp@m.om >
-
Thiemo Kreuz
-
Bene* < benes.nosp@m.tar..nosp@m.wikim.nosp@m.edia.nosp@m.@gmai.nosp@m.l.co.nosp@m.m >
◆ __construct()
Wikibase\DataModel\ReferenceList::__construct |
( |
| $references = [] | ) |
|
- Parameters
-
Reference[] | Traversable | $references | |
- Exceptions
-
◆ __serialize()
Wikibase\DataModel\ReferenceList::__serialize |
( |
| ) |
|
◆ __unserialize()
Wikibase\DataModel\ReferenceList::__unserialize |
( |
array | $data | ) |
|
◆ addNewReference()
Wikibase\DataModel\ReferenceList::addNewReference |
( |
| $snaks | ) |
|
- Since
- 1.1
- Parameters
-
Snak | ...$snaks (passing a single Snak[] is still supported but deprecated) |
- Exceptions
-
◆ addReference()
Wikibase\DataModel\ReferenceList::addReference |
( |
Reference | $reference, |
|
|
| $index = null ) |
Adds the provided reference to the list.
Empty references are ignored.
- Since
- 0.1
- Parameters
-
Reference | $reference | |
int | null | $index | New position of the added reference, or null to append. |
- Exceptions
-
◆ count()
Wikibase\DataModel\ReferenceList::count |
( |
| ) |
|
- See also
- Countable::count
- Returns
- int
◆ equals()
Wikibase\DataModel\ReferenceList::equals |
( |
| $target | ) |
|
The comparison is done purely value based, ignoring the order of the elements in the array.
- Since
- 0.3
- Parameters
-
- Returns
- bool
◆ getIterator()
Wikibase\DataModel\ReferenceList::getIterator |
( |
| ) |
|
- See also
- IteratorAggregate::getIterator
- Since
- 5.0
- Returns
- Iterator|Reference[]
◆ getReference()
Wikibase\DataModel\ReferenceList::getReference |
( |
| $referenceHash | ) |
|
Returns the first Reference object with the provided hash, or null if there is no such reference in the list.
- Since
- 0.3
- Parameters
-
- Returns
- Reference|null
◆ getValueHash()
Wikibase\DataModel\ReferenceList::getValueHash |
( |
| ) |
|
The hash is purely valuer based.
Order of the elements in the array is not held into account.
- Since
- 0.3
- Returns
- string
◆ hasReference()
Wikibase\DataModel\ReferenceList::hasReference |
( |
Reference | $reference | ) |
|
Returns if the list contains a reference with the same hash as the provided reference.
- Since
- 0.1
- Parameters
-
- Returns
- bool
◆ hasReferenceHash()
Wikibase\DataModel\ReferenceList::hasReferenceHash |
( |
| $referenceHash | ) |
|
Returns if the list contains a reference with the provided hash.
- Since
- 0.3
- Parameters
-
- Returns
- bool
◆ indexOf()
Wikibase\DataModel\ReferenceList::indexOf |
( |
Reference | $reference | ) |
|
Returns the index of the Reference object or false if the Reference could not be found.
- Since
- 0.5
- Parameters
-
- Returns
- int|bool
◆ insertReferenceAtIndex()
Wikibase\DataModel\ReferenceList::insertReferenceAtIndex |
( |
Reference | $reference, |
|
|
| $index ) |
|
private |
- Parameters
-
Reference | $reference | |
int | $index | |
◆ isEmpty()
Wikibase\DataModel\ReferenceList::isEmpty |
( |
| ) |
|
◆ removeReference()
Wikibase\DataModel\ReferenceList::removeReference |
( |
Reference | $reference | ) |
|
Removes the reference with the same hash as the provided reference if such a reference exists in the list.
- Since
- 0.1
- Parameters
-
◆ removeReferenceHash()
Wikibase\DataModel\ReferenceList::removeReferenceHash |
( |
| $referenceHash | ) |
|
Looks for the first Reference object in this list with the provided hash.
Removes all occurences of that object.
- Since
- 0.3
- Parameters
-
◆ serialize()
Wikibase\DataModel\ReferenceList::serialize |
( |
| ) |
|
- See also
- Serializable::serialize
- Since
- 2.1
- Returns
- string
◆ unserialize()
Wikibase\DataModel\ReferenceList::unserialize |
( |
| $serialized | ) |
|
- See also
- Serializable::unserialize
- Since
- 2.1
- Parameters
-
◆ $references
Wikibase\DataModel\ReferenceList::$references = [] |
|
private |
The documentation for this class was generated from the following file: