Class representing a single change (ie a row in the wb_changes).
More...
Class representing a single change (ie a row in the wb_changes).
- Copyright
- GPL-2.0-or-later
- Author
- Jeroen De Dauw < jeroe.nosp@m.nded.nosp@m.auw@g.nosp@m.mail.nosp@m..com >
-
Daniel Kinzler
◆ __construct()
Wikibase\Lib\Changes\ChangeRow::__construct |
( |
array |
$fields = [] | ) |
|
◆ getAge()
Wikibase\Lib\Changes\ChangeRow::getAge |
( |
| ) |
|
◆ getField()
Wikibase\Lib\Changes\ChangeRow::getField |
( |
|
$name | ) |
|
- Parameters
-
- Exceptions
-
Exception | if the requested field is not set |
- Returns
- mixed
◆ getFields()
Wikibase\Lib\Changes\ChangeRow::getFields |
( |
| ) |
|
Overwritten to unserialize the info field on the fly.
- Returns
- array
◆ getId()
Wikibase\Lib\Changes\ChangeRow::getId |
( |
| ) |
|
- Exceptions
-
Exception | if the "id" field is not set |
- Returns
- int|null Number to be used as an identifier when persisting the change.
Implements Wikibase\Lib\Changes\Change.
◆ getInfo()
Wikibase\Lib\Changes\ChangeRow::getInfo |
( |
|
$cache = 'no' | ) |
|
Returns the info array.
The array is deserialized on the fly. If $cache is set to 'cache', the deserialized version is stored for later re-use.
Usually, the deserialized version is not retained to preserve memory when lots of changes need to be processed. It can however be retained to improve performance in cases where the same object is accessed several times.
- Parameters
-
string | $cache | Set to 'cache' to cache the unserialized version of the info array. |
- Returns
- array
◆ getObjectId()
Wikibase\Lib\Changes\ChangeRow::getObjectId |
( |
| ) |
|
◆ getSerializedInfo()
Wikibase\Lib\Changes\ChangeRow::getSerializedInfo |
( |
|
$skipKeys = [] | ) |
|
|
abstract |
- Parameters
-
string[] | $skipKeys | Keys of the info array to skip during serialization. Useful for omitting undesired or unserializable data from the serialization. |
- Returns
- string JSON
Reimplemented in Wikibase\Lib\Changes\EntityChange.
◆ getTime()
Wikibase\Lib\Changes\ChangeRow::getTime |
( |
| ) |
|
◆ getUserId()
Wikibase\Lib\Changes\ChangeRow::getUserId |
( |
| ) |
|
◆ hasField()
Wikibase\Lib\Changes\ChangeRow::hasField |
( |
|
$name | ) |
|
Gets if a certain field is set.
- Parameters
-
- Returns
- bool
◆ setField()
Wikibase\Lib\Changes\ChangeRow::setField |
( |
|
$name, |
|
|
|
$value |
|
) |
| |
Sets the value of a field.
Strings can be provided for other types, so this method can be called from unserialization handlers.
- Parameters
-
◆ setFields()
Wikibase\Lib\Changes\ChangeRow::setFields |
( |
array |
$fields | ) |
|
Sets multiple fields.
- Parameters
-
array | $fields | The fields to set |
◆ setLogger()
Wikibase\Lib\Changes\ChangeRow::setLogger |
( |
LoggerInterface |
$logger | ) |
|
◆ unserializeInfo()
Wikibase\Lib\Changes\ChangeRow::unserializeInfo |
( |
|
$str | ) |
|
|
protected |
Unserializes the info field using json_decode.
This may be overridden by subclasses to implement special handling for information in the info field.
- Parameters
-
- Returns
- array the info array
Reimplemented in Wikibase\Lib\Changes\EntityChange.
◆ $fields
Wikibase\Lib\Changes\ChangeRow::$fields = [ 'id' => null ] |
|
private |
◆ $logger
Wikibase\Lib\Changes\ChangeRow::$logger |
|
protected |
The documentation for this class was generated from the following file: