src/Properties/Module.php
public function prepareWizardData()
    {
        $cacheKey = 'property-wizard' . md5(implode(':', $this->handlersList));
        $data = Yii::$app->cache->get($cacheKey);
        if (false === $data) {
            $query = (new Query())->from(PropertyHandlers::tableName())->indexBy('id')->select('class_name');
            if ((count($this->handlersList) != 0)) {
                $query->where(['class_name' => $this->handlersList]);
            }
            $handlers = $query->column();
            $storageToId = (new Query())->from(PropertyStorage::tableName())->indexBy('id')->select('class_name')->column();
            /**
             * @var AbstractPropertyHandler $className
             */
            foreach ($handlers as $id => $className) {
                $data[$id] = [
                    'id' => $id,
                    'allowedTypes' => $className::$allowedTypes,
                    'allowedStorage' => array_keys(array_intersect($storageToId, $className::$allowedStorage)),
                    'allowInSearch' => (bool)$className::$allowInSearch,
                    'multipleMode' => $className::$multipleMode
                ];
            }
            Yii::$app->cache->set(
                $cacheKey,
                $data,
                86400,
                new TagDependency(['tags' => [
                    NamingHelper::getCommonTag(PropertyHandlers::class),
                    NamingHelper::getCommonTag(PropertyStorage::class)
                ]])
            );
        }
        return $data;
    }
public function prepareWizardData()
    {
        $cacheKey = 'property-wizard' . md5(implode(':', $this->handlersList));
        $data = Yii::$app->cache->get($cacheKey);
        if (false === $data) {
            $query = (new Query())->from(PropertyHandlers::tableName())->indexBy('id')->select('class_name');
            if ((count($this->handlersList) != 0)) {
                $query->where(['class_name' => $this->handlersList]);
            }
            $handlers = $query->column();
            $storageToId = (new Query())->from(PropertyStorage::tableName())->indexBy('id')->select('class_name')->column();
            /**
             * @var AbstractPropertyHandler $className
             */
            foreach ($handlers as $id => $className) {
                $data[$id] = [
                    'id' => $id,
                    'allowedTypes' => $className::$allowedTypes,
                    'allowedStorage' => array_keys(array_intersect($storageToId, $className::$allowedStorage)),
                    'allowInSearch' => (bool)$className::$allowInSearch,
                    'multipleMode' => $className::$multipleMode
                ];
            }
            Yii::$app->cache->set(
                $cacheKey,
                $data,
                86400,
                new TagDependency(['tags' => [
                    NamingHelper::getCommonTag(PropertyHandlers::class),
                    NamingHelper::getCommonTag(PropertyStorage::class)
                ]])
            );
        }
        return $data;
    }
public function prepareWizardData ( ) { $ cacheKey = 'property-wizard' . md5 ( implode ( ':' , $ this -> handlersList ) ) ; $ data = Yii :: $ app -> cache -> get ( $ cacheKey ) ; if ( false === $ data ) { $ query = ( new Query ( ) ) -> from ( PropertyHandlers :: tableName ( ) ) -> indexBy ( 'id' ) -> select ( 'class_name' ) ; if ( ( count ( $ this -> handlersList ) != 0 ) ) { $ query -> where ( [ 'class_name' => $ this -> handlersList ] ) ; } $ handlers = $ query -> column ( ) ; $ storageToId = ( new Query ( ) ) -> from ( PropertyStorage :: tableName ( ) ) -> indexBy ( 'id' ) -> select ( 'class_name' ) -> column ( ) ; /**
             * @var AbstractPropertyHandler $className
             */ foreach ( $ handlers as $ id => $ className ) { $ data [ $ id ] = [ 'id' => $ id , 'allowedTypes' => $ className :: $ allowedTypes , 'allowedStorage' => array_keys ( array_intersect ( $ storageToId , $ className :: $ allowedStorage ) ) , 'allowInSearch' => ( bool ) $ className :: $ allowInSearch , 'multipleMode' => $ className :: $ multipleMode ] ; } Yii :: $ app -> cache -> set ( $ cacheKey , $ data , 86400 , new TagDependency ( [ 'tags' => [ NamingHelper :: getCommonTag ( PropertyHandlers :: class ) , NamingHelper :: getCommonTag ( PropertyStorage :: class ) ] ] ) ) ; } return $ data ; }
Prepares json string to use in js property creation wizard

@return array
Prepares json string to use in js property creation wizard