src/ngrest/plugins/SelectModel.php
private static function getDataInstance(ActiveQuery $query)
    {
        $class = $query->modelClass;
        
        $keys = [$class];
        if ($query->where) {
            foreach ($query->where as $v) {
                if (is_scalar($v)) {
                    $keys[] = $v;
                }
            }
        }

        $instanceName = implode(",", $keys);
        
        if (!isset(static::$_dataInstance[$instanceName])) {
            $queryData = $query->all();
            static::$_dataInstance[$instanceName] = $queryData;
        }
        
        return static::$_dataInstance[$instanceName];
    }
private static function getDataInstance(ActiveQuery $query)
    {
        $class = $query->modelClass;
        
        $keys = [$class];
        if ($query->where) {
            foreach ($query->where as $v) {
                if (is_scalar($v)) {
                    $keys[] = $v;
                }
            }
        }

        $instanceName = implode(",", $keys);
        
        if (!isset(static::$_dataInstance[$instanceName])) {
            $queryData = $query->all();
            static::$_dataInstance[$instanceName] = $queryData;
        }
        
        return static::$_dataInstance[$instanceName];
    }
private static function getDataInstance ( ActiveQuery $ query ) { $ class = $ query -> modelClass ; $ keys = [ $ class ] ; if ( $ query -> where ) { foreach ( $ query -> where as $ v ) { if ( is_scalar ( $ v ) ) { $ keys [ ] = $ v ; } } } $ instanceName = implode ( "," , $ keys ) ; if ( ! isset ( static :: $ _dataInstance [ $ instanceName ] ) ) { $ queryData = $ query -> all ( ) ; static :: $ _dataInstance [ $ instanceName ] = $ queryData ; } return static :: $ _dataInstance [ $ instanceName ] ; }
Data DI Container for relation data.

@param string $class
@param string|array $where
@return mixed
Data DI Container for relation data .