src/helpers/PropertyHandlerHelper.php
public function handlers()
    {
        if ($this->_handlers === null) {
            $this->_handlers = Yii::$app->cache->lazy(function () {
                $models = PropertyHandlers::find()
                    ->orderBy(['sort_order' => SORT_ASC])
                    ->all();

                $handlers = [];
                foreach ($models as $model) {
                    $className = $model->class_name;
                    $handlers[$model->id] = new $className($model->default_config);
                }

                return $handlers;
            }, 'AllPropertyHandlers', 86400, PropertyHandlers::commonTag());
        }
        return $this->_handlers;
    }
public function handlers()
    {
        if ($this->_handlers === null) {
            $this->_handlers = Yii::$app->cache->lazy(function () {
                $models = PropertyHandlers::find()
                    ->orderBy(['sort_order' => SORT_ASC])
                    ->all();

                $handlers = [];
                foreach ($models as $model) {
                    $className = $model->class_name;
                    $handlers[$model->id] = new $className($model->default_config);
                }

                return $handlers;
            }, 'AllPropertyHandlers', 86400, PropertyHandlers::commonTag());
        }
        return $this->_handlers;
    }
public function handlers ( ) { if ( $ this -> _handlers === null ) { $ this -> _handlers = Yii :: $ app -> cache -> lazy ( function ( ) { $ models = PropertyHandlers :: find ( ) -> orderBy ( [ 'sort_order' => SORT_ASC ] ) -> all ( ) ; $ handlers = [ ] ; foreach ( $ models as $ model ) { $ className = $ model -> class_name ; $ handlers [ $ model -> id ] = new $ className ( $ model -> default_config ) ; } return $ handlers ; } , 'AllPropertyHandlers' , 86400 , PropertyHandlers :: commonTag ( ) ) ; } return $ this -> _handlers ; }
Retrieves handlers from database.
Uses lazy cache.
@return \DevGroup\DataStructure\propertyHandler\AbstractPropertyHandler[]
Retrieves handlers from database . Uses lazy cache .