public static function gets($keys = null)
    {
        $noInitModel = static::buildNoInitModel();
        $query = static::find();
        if ($keys == null) {
            $models = $query->all();
        } elseif (is_array($keys)) {
            $array = [];
            foreach ($keys as $key) {
                if (is_string($key) && strlen($key)) {
                    $array[] = $key;
                }
            }
            $models = $query->where([$noInitModel->idAttribute => $array])->all();
        }
        $result = [];
        foreach ($models as $key => $model) {
            $result[$model->key] = $model->value;
        }
        return $result;
    }
public static function gets($keys = null)
    {
        $noInitModel = static::buildNoInitModel();
        $query = static::find();
        if ($keys == null) {
            $models = $query->all();
        } elseif (is_array($keys)) {
            $array = [];
            foreach ($keys as $key) {
                if (is_string($key) && strlen($key)) {
                    $array[] = $key;
                }
            }
            $models = $query->where([$noInitModel->idAttribute => $array])->all();
        }
        $result = [];
        foreach ($models as $key => $model) {
            $result[$model->key] = $model->value;
        }
        return $result;
    }
public static function gets ( $ keys = null ) { $ noInitModel = static :: buildNoInitModel ( ) ; $ query = static :: find ( ) ; if ( $ keys == null ) { $ models = $ query -> all ( ) ; } elseif ( is_array ( $ keys ) ) { $ array = [ ] ; foreach ( $ keys as $ key ) { if ( is_string ( $ key ) && strlen ( $ key ) ) { $ array [ ] = $ key ; } } $ models = $ query -> where ( [ $ noInitModel -> idAttribute => $ array ] ) -> all ( ) ; } $ result = [ ] ; foreach ( $ models as $ key => $ model ) { $ result [ $ model -> key ] = $ model -> value ; } return $ result ; }
Get meta values by specified keys. If one of keys doesn't exists, it will
not appear in return array.
@param string[] $keys
@return array meta key-value pairs.
Get meta values by specified keys . If one of keys doesn t exists it will not appear in return array .