<?php

namespace app\models;
use yii\mongodb\ActiveRecord;

class View extends ActiveRecord
{

    public static function collectionName() {
        return 'views';
    }

    public function attributes() {
        return ['_id', 'name', 'formId', 'createdAt', 'isDefaultView', 'domain', 'selectedMatrix', 'metaDataFilters', 'fileMetaDataFilters', 'matrixFilters',
            'isDefaultView', 'additionalData', 'selectedColumns', 'sorting', 'filters', 'statistics', 'childrenForms', 'selectedFiles'];
    }

    public function rules(){
        return [
            [['formId'], 'required', 'message' => 'Form cannot be blank.'],
            [['domain'], 'required', 'message' => 'Domain cannot be blank.'],
        ];
    }
}
