Class \Scrivo\ApplicationDefinition

The ApplicationDefinition class is used to create references to applications.

Scrivo applications are (small) specialized web applications that are hosted on a tab in the user interface. These can be internal applications such as list or form, or any custom made web application.

The application definition class holds the entry point (an url to display in an iframe or a Javascript class constructor) for the application.

Defined in: ApplicationDefinition.php.


Constructor summary

Attr. Name / Description
public

ApplicationDefinition($context)

Create an empty application definition object.

Constant summary

Name Description
TYPE_DISTRIBUTED_LIST Constant to denote distributed list.
TYPE_FORM Constant to denote a from application.
TYPE_LIST Constant to denote a news-like list application (manually sortable).
TYPE_LISTVIEW Constant to denote a column list application with sort option on headers.
TYPE_URL Constant to denote an external (custom) application.

Properties

Attr. Type Name Description
\..\String $description An additional description for the application.
read-only int $id The application definition id (DB key)
\..\String $location The location of the application start page.
\..\String $title A descriptive title for the application.
int $type The application type: one out of the ApplicationDefinition::TYPE_* constants.

Member summary

Attr. Type Name Description
private \..\Context $context A Scrivo context.
private \..\String $description An additional description for the application.
private int $id The application definition id (DB key)
private \..\String $location The location of the application start page.
private \..\String $title A descriptive title for the application.
private int $type The application type: one out of the ApplicationDefinition::TYPE_* constants.

Method summary

Attr. Type Name / Description
public mixed

__get($name)

Implementation of the readable properties using the PHP magic method __get().

public

__set($name, $value)

Implementation of the writable properties using the PHP magic method __set().

public static

delete($context, $id)

Delete existing application definition data from the database.

public static \..\ApplicationDefinition

fetch($context, $id)

Fetch a application definition object from the database using its object id.

public

insert()

Insert new application definition object data into the database.

public static \..\ApplicationDefinition[]

select($context)

Select application definitions from the database.

private

setDescription($description)

Set the additional description for the application.

private

setFields($context, $rd)

Convenience method to set the fields of a application definition object from an array (result set row).

private

setLocation($location)

Set the location of the application start page.

private

setTitle($title)

Set the descriptive title for the application.

private

setType($type)

Set the application type: one out of the ApplicationDefinition::TYPE_* constants.

public

update()

Update existing application definition object data in the database.

private static

validateDelete($context, $id)

Check if deletion of application definition object data does not violate any business rules.

private

validateInsert()

Check if this application definition object can be inserted into the database.

private

validateUpdate()

Check if this application definition object can be updated in the database.

 


Constructor

public ApplicationDefinition(\Scrivo\Context $context=null)

Create an empty application definition object.

Parameters:

Type Name Def. Description
\Scrivo\Context $context null

A Scrivo context.


Constants

TYPE_DISTRIBUTED_LIST

Constant to denote distributed list.

Value: 5

TYPE_FORM

Constant to denote a from application.

Value: 4

TYPE_LIST

Constant to denote a news-like list application (manually sortable).

Value: 2

TYPE_LISTVIEW

Constant to denote a column list application with sort option on headers.

Value: 3

TYPE_URL

Constant to denote an external (custom) application.

Value: 1


Members


				
private \Scrivo\Context $context

A Scrivo context.

Inital value: null


				
private \Scrivo\String $description

An additional description for the application.

Inital value: null


				
private int $id

The application definition id (DB key)

Inital value: 0


				
private \Scrivo\String $location

The location of the application start page.

Inital value: null


				
private \Scrivo\String $title

A descriptive title for the application.

Inital value: null


				
private int $type

The application type: one out of the ApplicationDefinition::TYPE_* constants.

Inital value: self::TYPE_URL


Methods

public mixed __get(string $name)

Implementation of the readable properties using the PHP magic method __get().

Parameters:

Type Name Def. Description
string $name

The name of the property to get.

Returns:

mixed Implementation of the readable properties using the PHP magic method __get().

public __set(string $name, mixed $value)

Implementation of the writable properties using the PHP magic method __set().

Parameters:

Type Name Def. Description
string $name

The name of the property to set.

mixed $value

The value of the property to set.

public static delete(\Scrivo\Context $context, int $id)

Delete existing application definition data from the database.

First it is is checked if it's possible to delete application definition data, then the application definition data including its dependencies is deleted from the database.

Parameters:

Type Name Def. Description
\Scrivo\Context $context

A Scrivo context.

int $id

The object id of the application definition to select.

Throws:

Exception Type Description
\Scrivo\ApplicationException If the data is not accessible or if it is not possible to delete the application definition data.
public static \Scrivo\ApplicationDefinition fetch(\Scrivo\Context $context, int $id)

Fetch a application definition object from the database using its object id.

Parameters:

Type Name Def. Description
\Scrivo\Context $context

A Scrivo context.

int $id

The object id of the application definition to select.

Returns:

\Scrivo\ApplicationDefinition Fetch a application definition object from the database using its object id.

public insert()

Insert new application definition object data into the database.

First it is checked if the data of this application definition object can be inserted into the database, then the data is inserted into the database. If no id was set a new object id is generated.

Throws:

Exception Type Description
\Scrivo\ApplicationException If the data is not accessible or one or more of the fields contain invalid data.
public static \Scrivo\ApplicationDefinition[id] select(\Scrivo\Context $context)

Select application definitions from the database.

Parameters:

Type Name Def. Description
\Scrivo\Context $context

A Scrivo context.

Returns:

\Scrivo\ApplicationDefinition[id] Select application definitions from the database.

private setDescription(\Scrivo\String $description)

Set the additional description for the application.

Parameters:

Type Name Def. Description
\Scrivo\String $description

An additional description for the application.

private setFields(\Scrivo\Context $context, array $rd)

Convenience method to set the fields of a application definition object from an array (result set row).

Parameters:

Type Name Def. Description
\Scrivo\Context $context

A Scrivo context.

array $rd

An array containing the field data using the database field names as keys.

private setLocation(\Scrivo\String $location)

Set the location of the application start page.

Parameters:

Type Name Def. Description
\Scrivo\String $location

The location of the application start page.

private setTitle(\Scrivo\String $title)

Set the descriptive title for the application.

Parameters:

Type Name Def. Description
\Scrivo\String $title

A descriptive title for the application.

private setType(int $type)

Set the application type: one out of the ApplicationDefinition::TYPE_* constants.

Parameters:

Type Name Def. Description
int $type

The application type: one out of the ApplicationDefinition::TYPE_* constants.

public update()

Update existing application definition object data in the database.

First it is checked if the data of this application definition object can be updated in the database, then the data is updated in the database.

Throws:

Exception Type Description
\Scrivo\ApplicationException If the data is not accessible or one or more of the fields contain invalid data.
private static validateDelete(\Scrivo\Context $context, int $id)

Check if deletion of application definition object data does not violate any business rules.

Parameters:

Type Name Def. Description
\Scrivo\Context $context

A Scrivo context.

int $id

The object id of the application definition to select.

Throws:

Exception Type Description
\Scrivo\ApplicationException If the data is not accessible or if it is not possible to delete the language data.
private validateInsert()

Check if this application definition object can be inserted into the database.

Throws:

Exception Type Description
\Scrivo\ApplicationException If the data is not accessible or one or more of the fields contain invalid data.
private validateUpdate()

Check if this application definition object can be updated in the database.

Throws:

Exception Type Description
\Scrivo\ApplicationException If the data is not accessible or one or more of the fields contain invalid data.

Documentation generated by phpDocumentor 2.0.0a12 and ScrivoDocumentor on August 29, 2013