Package: entity

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:

  1. "#", "int" or "integer" for Integer data type.

  2. "%" or "decimal" for DECIMAL data type.

  3. "@" or "datetime" for DATETIME data type.

  4. "&" or "string" for STRING data type.

  5. "&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

Property

Type

Description

name

string

The name of the customization set