public function filterFields(Model $model, $filter = array()) {
        if (empty($filter) || $filter === '*') {
            return $model->fields;
        }

        $fields = array();

        foreach ($filter as $field) {
            list($table, $field) = pluginSplit($field);

            $fields[$field] = $model->fields[$field];
        }

        return $fields;
    }