igniteui-webcomponents-datasources
Version:
Reference custom data providers for the Ignite UI Web Components data source.
51 lines (50 loc) • 1.35 kB
JavaScript
export class EntitySet {
constructor(name, entityType) {
this._entityName = null;
this._entityNamespace = null;
this._entityType = null;
this._name = null;
this.name = name;
this.entityType = entityType;
if (entityType.indexOf(".") >= 0) {
let parts = entityType.split('.');
if (parts.length == 2) {
this.entityNamespace = parts[0];
this.entityName = parts[1];
}
else {
let i = entityType.lastIndexOf('.');
this.entityNamespace = entityType.substr(0, i);
this.entityName = entityType.substr(i + 1);
}
}
else {
this.entityNamespace = entityType;
this.entityName = entityType;
}
}
get entityName() {
return this._entityName;
}
set entityName(value) {
this._entityName = value;
}
get entityNamespace() {
return this._entityNamespace;
}
set entityNamespace(value) {
this._entityNamespace = value;
}
get entityType() {
return this._entityType;
}
set entityType(value) {
this._entityType = value;
}
get name() {
return this._name;
}
set name(value) {
this._name = value;
}
}