\Comproso\Framework\ContractsElementContract

Definition for Elements.

This file defines the minimum requirements for Elements (i.e., test items/types). Comproso expects Elements to respond to data implementation, element generation, and template definition.

Summary

Methods
Constants
implement()
generate()
template()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

implement()

implement(array|object  $data) 

Implementation of given information.

This function is used to create a specific element based on the Element represented by this interface. For example, an Element (type) questionnaire is used, then this function will be used during test import to create a questionnaire item that will contain given $data.

Parameters

array|object $data

provides a data row that includes all available information for the specific element.

@return boolean return if implementation was (not) succesful.

generate()

generate(array|object|null  $cache = null) 

Generation of a specific Element.

This function is used to generate a specific Element and therefore to prepare an Element to be presented on the web browser (i.e., do the basic rendering).

Parameters

array|object|null $cache

providing cached or previous results/information of this element.

@return object expects to return a freshly generated (i.e., using 'new') Element.

template()

template() : string

Providing default template information.

This function provides information about the default template. It will become obsolete in future versions of comproso.

Returns

string —

template name.

@deprecated 0.8 This function will be deprecated from version 0.8.