X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FStorage%2FRevisionRecord.php;h=7d1b4778d48f4d3492dae4857f90ca1fcb906db8;hb=138298b397b308ad6e4bfc7088884d90e8ac1e37;hp=66ec2c07a2ee4c730cce58dd885e3113ed8ab858;hpb=6e956d55aac4e4d7e6145ed51c44311ca0e9b0c7;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Storage/RevisionRecord.php b/includes/Storage/RevisionRecord.php index 66ec2c07a2..7d1b4778d4 100644 --- a/includes/Storage/RevisionRecord.php +++ b/includes/Storage/RevisionRecord.php @@ -218,6 +218,48 @@ abstract class RevisionRecord { return $this->mSlots->getSlotRoles(); } + /** + * Returns the slots defined for this revision. + * + * @return RevisionSlots + */ + public function getSlots() { + return $this->mSlots; + } + + /** + * Returns the slots that originate in this revision. + * + * Note that this does not include any slots inherited from some earlier revision, + * even if they are different from the slots in the immediate parent revision. + * This is the case for rollbacks: slots of a rollback revision are inherited from + * the rollback target, and are different from the slots in the parent revision, + * which was rolled back. + * + * To find all slots modified by this revision against its immediate parent + * revision, use RevisionSlotsUpdate::newFromRevisionSlots(). + * + * @return RevisionSlots + */ + public function getOriginalSlots() { + return new RevisionSlots( $this->mSlots->getOriginalSlots() ); + } + + /** + * Returns slots inherited from some previous revision. + * + * "Inherited" slots are all slots that do not originate in this revision. + * Note that these slots may still differ from the one in the parent revision. + * This is the case for rollbacks: slots of a rollback revision are inherited from + * the rollback target, and are different from the slots in the parent revision, + * which was rolled back. + * + * @return RevisionSlots + */ + public function getInheritedSlots() { + return new RevisionSlots( $this->mSlots->getInheritedSlots() ); + } + /** * Get revision ID. Depending on the concrete subclass, this may return null if * the revision ID is not known (e.g. because the revision does not yet exist