getSchemaItemSync Method
getSchemaItemSync<T extends SchemaItem>(schemaNameOrKey, itemNameOrCtor?)
Gets the schema item from the specified schema if it exists in this SchemaContext.
Will return undefined if the cached schema is partially loaded. Use getSchemaItem to await until the schema is completely loaded.
getSchemaItemSync<T extends SchemaItem>(schemaNameOrKey: string | SchemaItemKey, itemNameOrCtor?: T): InstanceType<T> | undefined
@returns The requested schema item, or undefined if the item could not be found.
@example
const schemaItem = schemaContext.getSchemaItemSync(new SchemaItemKey("TestElement", new SchemaKey("TestSchema")));
const schemaItemWithCtor = schemaContext.getSchemaItemSync(new SchemaItemKey("TestElement", new SchemaKey("TestSchema")), EntityClass);
const schemaItemByName = schemaContext.getSchemaItemSync("TestSchema", "TestElement");
const schemaItemByNameWithCtor = schemaContext.getSchemaItemSync("TestSchema", "TestElement", EntityClass);
const schemaItemFullName = schemaContext.getSchemaItemSync("TestSchema:TestElement", EntityClass);
const schemaItemFullNameWithCtor = schemaContext.getSchemaItemSync("TestSchema:TestElement", EntityClass);
const schemaItemFullNameSep = schemaContext.getSchemaItemSync("TestSchema.TestElement", EntityClass);
const schemaItemFullNameSepWithCtor = schemaContext.getSchemaItemSync("TestSchema.TestElement", EntityClass);
| Parameter |
Type |
Description |
| schemaNameOrKey |
string | SchemaItemKey |
|
| itemNameOrCtor |
T |
|
Returns - InstanceType<T> | undefined
The requested schema item, or undefined if the item could not be found.
getSchemaItemSync<T extends SchemaItem>(schemaNameOrKey, itemNameOrCtor?)
Gets the schema item from the specified schema if it exists in this SchemaContext.
Will return undefined if the cached schema is partially loaded. Use getSchemaItem to await until the schema is completely loaded.
getSchemaItemSync<T extends SchemaItem>(schemaNameOrKey: string | SchemaItemKey, itemNameOrCtor?: T): SchemaItem | undefined
@returns The requested schema item, or undefined if the item could not be found.
@example
const schemaItem = schemaContext.getSchemaItemSync(new SchemaItemKey("TestElement", new SchemaKey("TestSchema")));
const schemaItemWithCtor = schemaContext.getSchemaItemSync(new SchemaItemKey("TestElement", new SchemaKey("TestSchema")), EntityClass);
const schemaItemByName = schemaContext.getSchemaItemSync("TestSchema", "TestElement");
const schemaItemByNameWithCtor = schemaContext.getSchemaItemSync("TestSchema", "TestElement", EntityClass);
const schemaItemFullName = schemaContext.getSchemaItemSync("TestSchema:TestElement", EntityClass);
const schemaItemFullNameWithCtor = schemaContext.getSchemaItemSync("TestSchema:TestElement", EntityClass);
const schemaItemFullNameSep = schemaContext.getSchemaItemSync("TestSchema.TestElement", EntityClass);
const schemaItemFullNameSepWithCtor = schemaContext.getSchemaItemSync("TestSchema.TestElement", EntityClass);
| Parameter |
Type |
Description |
| schemaNameOrKey |
string | SchemaItemKey |
|
| itemNameOrCtor |
T |
|
Returns - SchemaItem | undefined
The requested schema item, or undefined if the item could not be found.
getSchemaItemSync<T extends SchemaItem>(schemaNameOrKey, itemNameOrCtor, itemConstructor?)
Gets the schema item from the specified schema if it exists in this SchemaContext.
Will return undefined if the cached schema is partially loaded. Use getSchemaItem to await until the schema is completely loaded.
getSchemaItemSync<T extends SchemaItem>(schemaNameOrKey: string, itemNameOrCtor: string, itemConstructor?: T): InstanceType<T> | undefined
@returns The requested schema item, or undefined if the item could not be found.
@example
const schemaItem = schemaContext.getSchemaItemSync(new SchemaItemKey("TestElement", new SchemaKey("TestSchema")));
const schemaItemWithCtor = schemaContext.getSchemaItemSync(new SchemaItemKey("TestElement", new SchemaKey("TestSchema")), EntityClass);
const schemaItemByName = schemaContext.getSchemaItemSync("TestSchema", "TestElement");
const schemaItemByNameWithCtor = schemaContext.getSchemaItemSync("TestSchema", "TestElement", EntityClass);
const schemaItemFullName = schemaContext.getSchemaItemSync("TestSchema:TestElement", EntityClass);
const schemaItemFullNameWithCtor = schemaContext.getSchemaItemSync("TestSchema:TestElement", EntityClass);
const schemaItemFullNameSep = schemaContext.getSchemaItemSync("TestSchema.TestElement", EntityClass);
const schemaItemFullNameSepWithCtor = schemaContext.getSchemaItemSync("TestSchema.TestElement", EntityClass);
| Parameter |
Type |
Description |
| schemaNameOrKey |
string |
|
| itemNameOrCtor |
string |
|
| itemConstructor |
T |
|
Returns - InstanceType<T> | undefined
The requested schema item, or undefined if the item could not be found.
getSchemaItemSync<T extends SchemaItem>(schemaNameOrKey, itemNameOrCtor, itemConstructor?)
Gets the schema item from the specified schema if it exists in this SchemaContext.
Will return undefined if the cached schema is partially loaded. Use getSchemaItem to await until the schema is completely loaded.
getSchemaItemSync<T extends SchemaItem>(schemaNameOrKey: string, itemNameOrCtor: string, itemConstructor?: T): SchemaItem | undefined
@returns The requested schema item, or undefined if the item could not be found.
@example
const schemaItem = schemaContext.getSchemaItemSync(new SchemaItemKey("TestElement", new SchemaKey("TestSchema")));
const schemaItemWithCtor = schemaContext.getSchemaItemSync(new SchemaItemKey("TestElement", new SchemaKey("TestSchema")), EntityClass);
const schemaItemByName = schemaContext.getSchemaItemSync("TestSchema", "TestElement");
const schemaItemByNameWithCtor = schemaContext.getSchemaItemSync("TestSchema", "TestElement", EntityClass);
const schemaItemFullName = schemaContext.getSchemaItemSync("TestSchema:TestElement", EntityClass);
const schemaItemFullNameWithCtor = schemaContext.getSchemaItemSync("TestSchema:TestElement", EntityClass);
const schemaItemFullNameSep = schemaContext.getSchemaItemSync("TestSchema.TestElement", EntityClass);
const schemaItemFullNameSepWithCtor = schemaContext.getSchemaItemSync("TestSchema.TestElement", EntityClass);
| Parameter |
Type |
Description |
| schemaNameOrKey |
string |
|
| itemNameOrCtor |
string |
|
| itemConstructor |
T |
|
Returns - SchemaItem | undefined
The requested schema item, or undefined if the item could not be found.
Defined in