Use PHP 5.6 constant expressions for some bitfield constants
[lhc/web/wiklou.git] / includes / Storage / RevisionRecord.php
index 8734f48..ff0a70d 100644 (file)
@@ -48,8 +48,9 @@ abstract class RevisionRecord {
        const DELETED_COMMENT = 2;
        const DELETED_USER = 4;
        const DELETED_RESTRICTED = 8;
-       const SUPPRESSED_USER = 12; // convenience
-       const SUPPRESSED_ALL = 15; // convenience
+       const SUPPRESSED_USER = self::DELETED_USER | self::DELETED_RESTRICTED; // convenience
+       const SUPPRESSED_ALL = self::DELETED_TEXT | self::DELETED_COMMENT | self::DELETED_USER |
+               self::DELETED_RESTRICTED; // convenience
 
        // Audience options for accessors
        const FOR_PUBLIC = 1;
@@ -196,6 +197,17 @@ abstract class RevisionRecord {
                return $slot;
        }
 
+       /**
+        * Returns whether the given slot is defined in this revision.
+        *
+        * @param string $role The role name of the desired slot
+        *
+        * @return bool
+        */
+       public function hasSlot( $role ) {
+               return $this->mSlots->hasSlot( $role );
+       }
+
        /**
         * Returns the slot names (roles) of all slots present in this revision.
         * getContent() will succeed only for the names returned by this method.