private static function prepareStorage($config)
    {
        $list = isset($config['storage']) ? $config['storage'] : [];
        $list = is_array($list) ? $list : [$list];
        $query = PropertyStorage::find()->select('id')->where('class_name=:className');
        if (count($list) == 0) {
            return [$query->params([':className' => StaticValues::class])->scalar() => StaticValues::class];
        }
        $storage = [];
        foreach ($list as $storageClass) {
            $storageId = PropertyStorage::getDb()->cache(
                function ($db) use ($storageClass, $query) {
                    return $query
                        ->params([':className' => $storageClass])
                        ->scalar($db);
                },
                86400,
                new TagDependency(['tags' => [PropertyStorage::commonTag()]])
            );
            if (false === $storageId) {
                continue;
            }
            $storage[$storageId] = $storageClass;
        }
        return $storage;
    }
private static function prepareStorage($config)
    {
        $list = isset($config['storage']) ? $config['storage'] : [];
        $list = is_array($list) ? $list : [$list];
        $query = PropertyStorage::find()->select('id')->where('class_name=:className');
        if (count($list) == 0) {
            return [$query->params([':className' => StaticValues::class])->scalar() => StaticValues::class];
        }
        $storage = [];
        foreach ($list as $storageClass) {
            $storageId = PropertyStorage::getDb()->cache(
                function ($db) use ($storageClass, $query) {
                    return $query
                        ->params([':className' => $storageClass])
                        ->scalar($db);
                },
                86400,
                new TagDependency(['tags' => [PropertyStorage::commonTag()]])
            );
            if (false === $storageId) {
                continue;
            }
            $storage[$storageId] = $storageClass;
        }
        return $storage;
    }
private static function prepareStorage ( $ config ) { $ list = isset ( $ config [ 'storage' ] ) ? $ config [ 'storage' ] : [ ] ; $ list = is_array ( $ list ) ? $ list : [ $ list ] ; $ query = PropertyStorage :: find ( ) -> select ( 'id' ) -> where ( 'class_name=:className' ) ; if ( count ( $ list ) == 0 ) { return [ $ query -> params ( [ ':className' => StaticValues :: class ] ) -> scalar ( ) => StaticValues :: class ] ; } $ storage = [ ] ; foreach ( $ list as $ storageClass ) { $ storageId = PropertyStorage :: getDb ( ) -> cache ( function ( $ db ) use ( $ storageClass , $ query ) { return $ query -> params ( [ ':className' => $ storageClass ] ) -> scalar ( $ db ) ; } , 86400 , new TagDependency ( [ 'tags' => [ PropertyStorage :: commonTag ( ) ] ] ) ) ; if ( false === $ storageId ) { continue ; } $ storage [ $ storageId ] = $ storageClass ; } return $ storage ; }
Prepares list of applicable storage

@param array $config
@return array
Prepares list of applicable storage