function allActAs() { return UserCacheComponent::getInstance()->allActAs(); }
function clear($key, $id = null) { $self =& UserCacheComponent::getInstance(); $self->initializeId(); if (!$id) { $id = $self->my_id; if (!$id) { return; } } if (empty($self->data[$id])) { $self->data[$id] = Cache::read("person/{$id}", 'file'); if (empty($self->data[$id])) { $self->data[$id] = array(); } } if (strpos($key, '.') !== false) { list($key, $subkey) = explode('.', $key); } else { $subkey = null; } if (!array_key_exists($key, $self->data[$id]) || !empty($subkey) && !array_key_exists($subkey, $self->data[$id][$key])) { return; } if ($subkey) { unset($self->data[$id][$key][$subkey]); } else { unset($self->data[$id][$key]); } Cache::write("person/{$id}", $self->data[$id], 'file'); }
function is_coordinator($league, $person_id = null, $all = false) { $coordinated_divisions = UserCacheComponent::getInstance()->read('DivisionIDs', $person_id); if (empty($coordinated_divisions)) { return false; } if (is_array($league)) { $league_divisions = Set::extract('/Division/id', $league); } else { $league_divisions = $this->divisions($league); } $intersection = array_intersect($coordinated_divisions, $league_divisions); if ($all) { return count($league_divisions) == count($intersection); } else { return !empty($intersection); } }