getConstants(); $reader = Reader::createFromDefaults(); foreach ($constants as $constName => $value) { $annotations = $reader->getConstantAnnotations(static::class, $constName); $isInternal = $annotations->get('internal', false); $owner = $annotations->get('owner', 'user'); $keyValue = [ 'value' => $value, 'internal' => $isInternal, 'owner' => $owner, ]; $scopes[$constName] = $keyValue; } Yii::$app->cache->set($cacheKey, $scopes, 3600); } return $scopes; } }