Pwirth has uploaded a new change for review. ( 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(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/75/376475/1 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: newchange Gerrit-Change-Id: Ic7796d91d1748664236d2b8d73a5328d324fc60b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Pwirth <wi...@hallowelt.biz> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits