function add($originalObj, $obj) { // I don't know if globals is the best way to do this or not, but it seems better than hitting the database a million times $identifier = PermissionsCache::getIdentifier($originalObj); PermissionsCache::$permCache[$identifier] = $obj; }