text: 'use strict';
  // import Auto_userScopes from './userScopes.auto.js';
  import Q from 'q';
  import utils from '../utils';
  export default class Auto_userScopes {
    constructor(owner) {
      this.sequelize = owner.sequelize;
      this.models = owner.models;
      this.security = owner.security;
    }
    create(obj) {
      return utils.executeModel(this.sequelize, this.models.userScopes, 'create', [obj]);
    }
    update(obj) {
      let object_id_objects = obj.object_id_objects;
      delete obj.object_id_objects;
      let user_id_users = obj.user_id_users;
      delete obj.user_id_users;
      let where = {
        where: {
          object_id_objects: object_id_objects,
          user_id_users: user_id_users,
        }
      };
      return utils.executeModel(this.sequelize, this.models.userScopes, 'update', [obj, where]);
    }
    delete(obj) {
      let params = {
        object_id_objects: obj.object_id_objects,
        user_id_users: obj.user_id_users,
      };
      let where = {
        where: params
      };
      return utils.executeModel(this.sequelize, this.models.userScopes, 'destroy', [where]);
    }
    findAll(filters, notWhere) {
      filters = filters || {};
      let where = {
        where: filters
      };
      if (notWhere) {
        where = filters
      }
      return utils.executeModel(this.sequelize, this.models.userScopes, 'findAll', [where]);
    }
    findAndCountAll(filters, notWhere) {
      filters = filters || {};
      let where = {
        where: filters
      };
      if (notWhere) {
        where = filters
      }
      return utils.executeModel(this.sequelize, this.models.userScopes, 'findAndCountAll', [where]);
    }
    findOne(params, notWhere) {
      let where = {
        where: params
      };
      if (notWhere) {
        where = params
      }
      return utils.executeModel(this.sequelize, this.models.userScopes, 'findOne', [where]);
    }
    getById(object_id_objects, user_id_users) {
      let params = {
        object_id_objects: object_id_objects,
        user_id_users: user_id_users,
      };
      return this.findOne(params);
    }
  }