Robert Vogel has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/376475 )

Change subject: BSFoundation: Fixed Entity default ns and instance 'cache'
......................................................................


BSFoundation: Fixed Entity default ns and instance 'cache'

Change-Id: Ic7796d91d1748664236d2b8d73a5328d324fc60b
---
M src/Entity.php
1 file changed, 5 insertions(+), 5 deletions(-)

Approvals:
  Robert Vogel: Verified; Looks good to me, approved



diff --git a/src/Entity.php b/src/Entity.php
index 0de18dd..e8bb3d9 100644
--- a/src/Entity.php
+++ b/src/Entity.php
@@ -30,7 +30,7 @@
 use BlueSpice\Content\Entity as EntityContent;
 
 abstract class Entity implements \JsonSerializable {
-       const NS = '';
+       const NS = -1;
        protected static $aEntitiesByID = array();
        protected $bUnsavedChanges = true;
 
@@ -353,7 +353,7 @@
                if( static::hasCacheEntry( $oInstance->getID() ) ) {
                        return $oInstance;
                }
-               static::$aEntitiesByID[$oInstance->getID()] = $oInstance;
+               static::$aEntitiesByID[static::NS][$oInstance->getID()] = 
$oInstance;
                return $oInstance;
        }
 
@@ -366,7 +366,7 @@
                if( !static::hasCacheEntry($oInstance->getID()) ) {
                        return $oInstance;
                }
-               unset( static::$aEntitiesByID[$oInstance->getID()] );
+               unset( static::$aEntitiesByID[static::NS][$oInstance->getID()] 
);
                return $oInstance;
        }
 
@@ -379,11 +379,11 @@
                if( !static::hasCacheEntry( $iID ) ) {
                        return null;
                }
-               return static::$aEntitiesByID[(int) $iID];
+               return static::$aEntitiesByID[static::NS][(int) $iID];
        }
 
        protected static function hasCacheEntry( $iID ) {
-               return isset( static::$aEntitiesByID[(int) $iID] );
+               return isset( static::$aEntitiesByID[static::NS][(int) $iID] );
        }
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/376475
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic7796d91d1748664236d2b8d73a5328d324fc60b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Pwirth <[email protected]>
Gerrit-Reviewer: Ljonka <[email protected]>
Gerrit-Reviewer: Mglaser <[email protected]>
Gerrit-Reviewer: Robert Vogel <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to