protected function initializeAttributes() {
parent::initializeAttributes();
- initialise_entity_cache();
-
$this->attributes['guid'] = "";
$this->attributes['type'] = "";
$this->attributes['subtype'] = "";
*
* @param int $user_guid The user.
* @param string $type The type of entity we're looking to write
- * @param string $subtype The subtype of the entity we're looking to write
- *
+ * @param string $subtype The subtype of the entity we're looking to write
+ *
* @return bool
*/
public function canWriteToContainer($user_guid = 0, $type = 'all', $subtype = 'all') {
* @global array $ENTITY_CACHE
* @access private
*/
-$ENTITY_CACHE = NULL;
+$ENTITY_CACHE = array();
/**
* Cache subtypes and related class names once loaded.
*/
$SUBTYPE_CACHE = NULL;
-/**
- * Initialise the entity cache.
- *
- * @return void
- * @todo remove this.
- * @access private
- */
-function initialise_entity_cache() {
- global $ENTITY_CACHE;
-
- if (!$ENTITY_CACHE) {
- $ENTITY_CACHE = array();
- }
-}
-
/**
* Invalidate this class's entry in the cache.
*
public function testElggEntityCache() {
global $ENTITY_CACHE;
- $ENTITY_CACHE = NULL;
-
- $this->assertNull($ENTITY_CACHE);
- initialise_entity_cache();
$this->assertIsA($ENTITY_CACHE, 'array');
}