Package: entity
- 1 Examples
- 2 API
- 2.1 Methods
- 2.1.1 createCustomizationSet
- 2.1.2 createEntity
- 2.1.3 createEntityACL
- 2.1.4 alterEntity
- 2.1.5 createProperty
- 2.1.6 createRelationship
- 2.1.7 createRelationshipEx
- 2.1.8 publish
- 2.1.9 unpublish
- 2.1.10 changeOwnership
- 2.2 Types
- 2.2.1 customizationset
- 2.1 Methods
Examples
Create a new entity
//Create the customization set variable to hold the required changes
var cs = entity->createCustomizationSet();
//Create a new entity
entity->createEntity(cs, "product");
entity->createEntity(cs, "category");
//Create some properties
entity->createProperty(cs, "product", "name", "string",
/*isRequired = */ true, "");
entity->createProperty(cs, "product", "description", "string31",
/*isRequired = */ false, "");
entity->createProperty(cs, "product", "price", "decimal",
/*isRequired = */ false, /*defaultValue = */ "0");
//Create a relationship
entity->createRelationship(cs,
/*relationshipName = */ "product_category", "n:1",
"product", "category",
null, null,
/*isRequired = */ false)
//Publish the customization set
entity->publish(cs);
API
Methods
createCustomizationSet
function createCustomizationSet() as customizationset
Creates a new customization set.
createEntity
method createEntity(cs as customizationset, entityName as string)
Creates an entity.
createEntityACL
Creates an entity with ACL enabled.
alterEntity
Alters an entity by enabling or disabling ACL.
createProperty
Creates a property.
type
can be one of the following:
"#"
,"int"
or"integer"
for Integer data type."%"
or"decimal"
for DECIMAL data type."@"
or"datetime"
for DATETIME data type."&"
or"string"
for STRING data type."&31"
or"string31"
for STRING31 data type.
createRelationship
Creates a relationship.
relationshipTypeName
can be one of the following: OneToMany
, OneToOne
, ManyToMany
, ManyToOne
, ParentChild
, ChildParent
createRelationshipEx
Creates a relationship with sorting options.
publish
unpublish
changeOwnership
Since 1.7.0
Types
customizationset
Property | Type | Description |
---|---|---|
name | string | The name of the customization set |