BmobRoleTable constructor

BmobRoleTable({
  1. String? name,
  2. List<BmobUserTable> users = const [],
  3. List<BmobRoleTable> roles = const [],
})

Implementation

BmobRoleTable(
    {this.name,
    List<BmobUserTable> users = const [],
    List<BmobRoleTable> roles = const []}) {
  assert(users.isEmpty || !users.any((element) => element.objectId.isEmpty));
  assert(roles.isEmpty || !roles.any((element) => element.objectId.isEmpty));
  if (users.isNotEmpty) {
    _users = BmobRelation(
      this,
      BmobUserTable(),
      'users',
      (json) => BmobUserTable().fromJson(json),
      users,
    );
  }
  if (roles.isNotEmpty) {
    _roles = BmobRelation(
      this,
      BmobRoleTable(),
      'roles',
      (json) => BmobRoleTable().fromJson(json),
      roles,
    );
  }
}