SD_ElementsContainer
extends SC_Data
in package
Encapsulates an Element so it acts as a Data.
Tags
Table of Contents
- $methodsFamilies : mixed
- $permissions : mixed
- $AdminMsg : mixed
- $allowCreateButton : mixed
- $autoIncrement : mixed
- $CancelBtnMsg : mixed
- $column : mixed
- $create : bool
- indicates if the SimplOndata must be used in the add(capture) from
- $CreateBtnMsg : mixed
- $CreatedMsg : mixed
- $CreateError : mixed
- $CreateMsg : mixed
- $delete : bool
- RSL 2022 aded "e Emebded" indicates if the SimplOndata must bre printed when deliting the element
- $DeleteBtnMsg : mixed
- $DeletedMsg : mixed
- $DeleteError : mixed
- $DeleteMsg : mixed
- $element : SC_Element
- Encapsulated element
- $elements : array<string|int, mixed>
- List of Elements
- $embeded : bool
- RSL 2022 aded "e Emebded" indicates if the SimplOndata must bre printed when its parrent element i contained within another element
- $fetch : bool
- indicates if the SimplOndata must have a value in order to allow the storage of it's dataParent SimplOnelement
- $filterCriteria : string
- search operands: > < >= <= == != ~= ^= $=
- $fixedValue : mixed
- $inputName : string
- The name of the input field for forms.
- $invalidValueMessage : mixed
- $label : ing
- Data name or label as it must be presented to human readers (in forms, html tables, etc)
- $layout : mixed
- $list : bool
- indicates if the SimplOndata must be used when several items are listed on a html table or list
- $name : mixed
- $parent : SC_Element
- Logic parent
- $pivot : mixed
- $printValInInput : mixed
- $renderer : SR_htmlJQuery
- $renderOverride : mixed
- $required : bool
- indicates if the SimplOndata must have a value in order to allow the storage of it's dataParent SimplOnelement
- $ReturnBtnMsg : mixed
- $search : bool
- indicates if the SimplOndata must be used in the search from
- $SearchBtnMsg : mixed
- $SearchMsg : mixed
- $tagId : mixed
- $tip : mixed
- $tipInline : mixed
- $update : bool
- indicates if the SimplOndata must be used in the update from
- $UpdateBtnMsg : mixed
- $UpdatedMsg : mixed
- $UpdateError : mixed
- $UpdateMsg : mixed
- $val : mixed
- Data value
- $validationRequired : mixed
- $view : bool
- indicates if the SimplOndata must be used when generating the default HTML template
- $ViewBtnMsg : mixed
- $ViewMsg : mixed
- __call() : mixed
- Auto Makes the Setters and Getters
- __construct() : mixed
- Constructs a new SC_Data instance.
- __toString() : string
- Tells PHP how to render this object as a string
- allowCreateButton() : mixed
- appendInput() : mixed
- checkPermissions() : mixed
- clear() : mixed
- Clears the value of a property or attribute
- clearValue() : mixed
- Clears the value of the Data object.
- dataFlags() : string|void
- Sets create, update, search, list, required and fetch flags according to the letters in $flags
- doCreate() : array<string|int, mixed>|null
- Prepares data for a create operation in the data source.
- doDelete() : mixed
- Performs actions during a delete operation.
- doRead() : array<string|int, mixed>|null
- Prepares data for a read operation from the data source.
- doSearch() : array<string|int, mixed>|null
- Prepares data for a search operation on the data source.
- doUpdate() : array<string|int, mixed>|null
- Prepares data for an update operation in the data source.
- filterCriteria() : mixed
- fixValue() : mixed
- Sets and fixes the value of the Data object, preventing further changes.
- getClass() : string
- Returns the object's class
- getJS() : array<string|int, mixed>
- function getJS - this function modifies the url of the encapsulated element to don't display a incorrect url
- hasAttribute() : bool
- Checks if a an object has a specific method
- hasProperty() : bool
- Checks if a an object has a specific property
- hiddenSelector() : mixed
- inputName() : string
- Gives the name of the field for the create or update forms (usualy an HTML form)
- inputVal() : mixed|string
- Returns the value to be used in input fields, based on the `printValInInput` flag.
- instanceId() : mixed
- Run time id of the object used to creat ids to link things in the interface like Labels and Inputs
- InterfaceId() : string
- Returns a unique Interface ID for the Data object instance.
- isValid() : bool
- Validates the given value.
- label() : string
- Returns or sets the label for the data object.
- makeAppendSelection() : mixed
- makeSelection() : mixed
- name() : mixed
- ObjectId() : mixed
- Class and instance id
- options() : mixed
- optionsDisplay() : mixed
- parent() : Element
- permissions() : mixed
- postCreate() : mixed
- Performs actions after data is created in the data source.
- postDelete() : mixed
- Performs actions after data is deleted from the data source.
- postRead() : mixed
- Performs actions after data is read from the data source.
- postSearch() : mixed
- Performs actions after a search is executed on the data source.
- postUpdate() : mixed
- Performs actions after data is updated in the data source.
- preCreate() : mixed
- Performs actions before data is created in the data source.
- preDelete() : mixed
- Performs actions before data is deleted from the data source.
- preRead() : mixed
- Performs actions before data is read from the data source.
- preSearch() : mixed
- Performs actions before a search is executed on the data source.
- preUpdate() : mixed
- Performs actions before data is updated in the data source.
- processElementCreate() : mixed
- refreshElementSelect() : mixed
- renderer() : SR_htmlJQuery
- Gets or sets the renderer for this Data object.
- showCreate() : mixed
- Generates the input field for creating a new data entry.
- showDelete() : mixed
- Generates the output for displaying the data in a deletion context.
- showElementCreate() : mixed
- showElementSelect() : mixed
- showEmbeded() : mixed
- Displays the data in an embedded context.
- showEmbededSearchInput() : mixed
- showEmbededStrip() : mixed
- Returns a stripped-down, embedded representation of the Data value.
- showEmbededUpdateInput() : string
- function showEmbededUpdateInput - this function works after function showInput, after have listed or added new values you can edit them or delete them without modify the original values and put the HTML to do it.
- showList() : mixed
- Displays the data for a list view.
- showSearch() : mixed
- Generates the input field or display for searching based on this data.
- showUpdate() : mixed
- Generates the input field for updating an existing data entry.
- showView() : mixed
- Displays the data for a single item view.
- val() : mixed
- Gets or sets the value of the Data object.
- viewVal() : mixed
- Returns the value of the Data object for viewing.
Properties
$methodsFamilies
public
static mixed
$methodsFamilies
$permissions
public
static mixed
$permissions
$AdminMsg
protected
mixed
$AdminMsg
= array()
$allowCreateButton
protected
mixed
$allowCreateButton
$autoIncrement
protected
mixed
$autoIncrement
= \true
$CancelBtnMsg
protected
mixed
$CancelBtnMsg
= array()
$column
protected
mixed
$column
$create
indicates if the SimplOndata must be used in the add(capture) from
protected
bool
$create
= \true
$CreateBtnMsg
protected
mixed
$CreateBtnMsg
= array()
$CreatedMsg
protected
mixed
$CreatedMsg
= array()
$CreateError
protected
mixed
$CreateError
= array()
$CreateMsg
protected
mixed
$CreateMsg
= array()
$delete
RSL 2022 aded "e Emebded" indicates if the SimplOndata must bre printed when deliting the element
protected
bool
$delete
= \true
$DeleteBtnMsg
protected
mixed
$DeleteBtnMsg
= array()
$DeletedMsg
protected
mixed
$DeletedMsg
= array()
$DeleteError
protected
mixed
$DeleteError
= array()
$DeleteMsg
protected
mixed
$DeleteMsg
= array()
$element
Encapsulated element
protected
SC_Element
$element
$elements
List of Elements
protected
array<string|int, mixed>
$elements
= array()
of Element
$embeded
RSL 2022 aded "e Emebded" indicates if the SimplOndata must bre printed when its parrent element i contained within another element
protected
bool
$embeded
= \true
$fetch
indicates if the SimplOndata must have a value in order to allow the storage of it's dataParent SimplOnelement
protected
bool
$fetch
= \true
$filterCriteria
search operands: > < >= <= == != ~= ^= $=
protected
string
$filterCriteria
= \true
Complex operations are just simple operations jointed with ANDs and ORs, so it'd be possible to create "Operators" objects that defines those complex operations.
(name > val1) OR (name < val2)
a <= x <= b a > x || x < b
$fixedValue
protected
mixed
$fixedValue
= \true
$inputName
The name of the input field for forms.
protected
string
$inputName
= \true
Tags
$invalidValueMessage
protected
mixed
$invalidValueMessage
= \true
$label
Data name or label as it must be presented to human readers (in forms, html tables, etc)
protected
ing
$label
= \true
Tags
$layout
protected
mixed
$layout
= array()
$list
indicates if the SimplOndata must be used when several items are listed on a html table or list
protected
bool
$list
= \true
$name
protected
mixed
$name
= \true
$parent
Logic parent
protected
SC_Element
$parent
$pivot
protected
mixed
$pivot
= array()
$printValInInput
protected
mixed
$printValInInput
= \true
$renderer
protected
SR_htmlJQuery
$renderer
= \true
$renderOverride
protected
mixed
$renderOverride
= \true
$required
indicates if the SimplOndata must have a value in order to allow the storage of it's dataParent SimplOnelement
protected
bool
$required
= \true
$ReturnBtnMsg
protected
mixed
$ReturnBtnMsg
= array()
$search
indicates if the SimplOndata must be used in the search from
protected
bool
$search
= \true
$SearchBtnMsg
protected
mixed
$SearchBtnMsg
= array()
$SearchMsg
protected
mixed
$SearchMsg
= array()
$tagId
protected
mixed
$tagId
= array()
$tip
protected
mixed
$tip
= \true
$tipInline
protected
mixed
$tipInline
= \true
$update
indicates if the SimplOndata must be used in the update from
protected
bool
$update
= \true
$UpdateBtnMsg
protected
mixed
$UpdateBtnMsg
= array()
$UpdatedMsg
protected
mixed
$UpdatedMsg
= array()
$UpdateError
protected
mixed
$UpdateError
= array()
$UpdateMsg
protected
mixed
$UpdateMsg
= array()
$val
Data value
protected
mixed
$val
= \true
Tags
$validationRequired
protected
mixed
$validationRequired
= \true
$view
indicates if the SimplOndata must be used when generating the default HTML template
protected
bool
$view
= \true
$ViewBtnMsg
protected
mixed
$ViewBtnMsg
= array()
$ViewMsg
protected
mixed
$ViewMsg
= array()
Methods
__call()
Auto Makes the Setters and Getters
public
__call( $name, $arguments) : mixed
Parameters
Return values
mixed —__construct()
Constructs a new SC_Data instance.
public
__construct(mixed $element[, mixed $labelORid = null ][, mixed $column = null ][, mixed $flags = null ][, mixed $element_id = null ]) : mixed
Initializes the Data object with a label, optional flags, an initial value, and filter criteria. Sets default validation messages for required fields and invalid values using the localization function. Applies the provided flags if available.
Parameters
- $element : mixed
- $labelORid : mixed = null
- $column : mixed = null
- $flags : mixed = null
-
VCUSRLF flags indicating where the Data will be used within an Element. dataFlags. Defaults to null.
- $element_id : mixed = null
Return values
mixed —__toString()
Tells PHP how to render this object as a string
public
__toString() : string
Return values
string —allowCreateButton()
public
allowCreateButton([mixed $allowCreateButton = null ]) : mixed
Parameters
- $allowCreateButton : mixed = null
Return values
mixed —appendInput()
public
appendInput() : mixed
Return values
mixed —checkPermissions()
public
checkPermissions(mixed $element, mixed $method) : mixed
Parameters
- $element : mixed
- $method : mixed
Return values
mixed —clear()
Clears the value of a property or attribute
public
clear(string $name) : mixed
Parameters
- $name : string
Return values
mixed —clearValue()
Clears the value of the Data object.
public
clearValue() : mixed
Return values
mixed —dataFlags()
Sets create, update, search, list, required and fetch flags according to the letters in $flags
public
dataFlags([string|null $flags = null ]) : string|void
The flags are represented by a string where each character indicates a specific use case: 'v' (view), 'c' (create), 'u' (update), 's' (search), 'l' (list), 'e' (embeded), 'r' (required), 'f' (fetch). Uppercase letters set the flag to true, lowercase letters set it to false.
Parameters
- $flags : string|null = null
-
Optional. A string containing the flags to set. If null, the current flags string is returned.
Return values
string|void —Returns the current flags string if $flags is null, otherwise sets the flags and returns nothing.
doCreate()
Prepares data for a create operation in the data source.
public
doCreate() : array<string|int, mixed>|null
This method is called by the parent Element's processData('doCreate')
method.
It should return an array of data relevant for creation if the data is creatable.
Return values
array<string|int, mixed>|null —An array containing data for the create operation, or null if the data is not creatable.
doDelete()
Performs actions during a delete operation.
public
doDelete() : mixed
This method is called by the parent Element's processData('doDelete')
method.
Child classes can override this to perform specific actions during deletion.
Tags
Return values
mixed —doRead()
Prepares data for a read operation from the data source.
public
doRead() : array<string|int, mixed>|null
This method is called by the parent Element's processData('doRead')
method.
It should return an array of data relevant for reading if the data is fetchable.
Return values
array<string|int, mixed>|null —An array containing data for the read operation, or null if the data is not fetchable.
doSearch()
Prepares data for a search operation on the data source.
public
doSearch() : array<string|int, mixed>|null
This method is called by the parent Element's processData('doSearch')
method.
It should return an array of data relevant for searching if the data is searchable and fetchable.
Return values
array<string|int, mixed>|null —An array containing data for the search operation, or null if the data is not searchable or fetchable.
doUpdate()
Prepares data for an update operation in the data source.
public
doUpdate() : array<string|int, mixed>|null
This method is called by the parent Element's processData('doUpdate')
method.
It should return an array of data relevant for updating if the data is updatable.
Return values
array<string|int, mixed>|null —An array containing data for the update operation, or null if the data is not updatable.
filterCriteria()
public
filterCriteria([mixed $filterCriteria = null ]) : mixed
Parameters
- $filterCriteria : mixed = null
Return values
mixed —fixValue()
Sets and fixes the value of the Data object, preventing further changes.
public
fixValue(mixed $val) : mixed
It also sets a render override to 'showFixedValue', thats used on the form interfaces.
Parameters
- $val : mixed
-
The value to set and fix.
Return values
mixed —getClass()
Returns the object's class
public
getClass() : string
Return values
string —The short class name of the object instance.
getJS()
function getJS - this function modifies the url of the encapsulated element to don't display a incorrect url
public
getJS(string $method) : array<string|int, mixed>
Parameters
- $method : string
Return values
array<string|int, mixed> —hasAttribute()
Checks if a an object has a specific method
public
hasAttribute(mixed $attribute) : bool
Parameters
- $attribute : mixed
Return values
bool —hasProperty()
Checks if a an object has a specific property
public
hasProperty(string $propName) : bool
Parameters
- $propName : string
Return values
bool —hiddenSelector()
public
hiddenSelector() : mixed
Return values
mixed —inputName()
Gives the name of the field for the create or update forms (usualy an HTML form)
public
inputName([string|null $inputName = null ]) : string
Parameters
- $inputName : string|null = null
-
Optional. The name to set for the input field. If null, the current input name is returned or derived.
Return values
string —The name of the input field.
inputVal()
Returns the value to be used in input fields, based on the `printValInInput` flag.
public
inputVal() : mixed|string
Return values
mixed|string —The data value or an empty string.
instanceId()
Run time id of the object used to creat ids to link things in the interface like Labels and Inputs
public
instanceId() : mixed
Return values
mixed —InterfaceId()
Returns a unique Interface ID for the Data object instance.
public
InterfaceId() : string
This ID can be used for generating unique Interface element IDs in forms or other interfaces.
Return values
string —A unique Interface ID for the instance.
isValid()
Validates the given value.
public
isValid(mixed $val) : bool
This is a base implementation that always returns true. Child classes should override this method to provide specific validation logic for their data type.
Parameters
- $val : mixed
-
The value to validate.
Return values
bool —True if the value is valid, false otherwise.
label()
Returns or sets the label for the data object.
public
label([string|null $label = null ]) : string
If setting, it updates the internal label. If getting and no label is set, it generates one from the data name and applies localization.
Parameters
- $label : string|null = null
-
Optional. The label to set. If null, the current label is returned.
Tags
Return values
string —The localized label for the data object.
makeAppendSelection()
public
makeAppendSelection(mixed $tagId, mixed $inputName) : mixed
Parameters
- $tagId : mixed
- $inputName : mixed
Return values
mixed —makeSelection()
public
makeSelection(mixed $id) : mixed
Parameters
- $id : mixed
Return values
mixed —name()
public
name([mixed $name = null ]) : mixed
Parameters
- $name : mixed = null
Return values
mixed —ObjectId()
Class and instance id
public
ObjectId() : mixed
Return values
mixed —options()
public
options() : mixed
Return values
mixed —optionsDisplay()
public
optionsDisplay() : mixed
Return values
mixed —parent()
public
parent([Element &$parent = null ]) : Element
Parameters
- $parent : Element = null
Return values
Element —permissions()
public
permissions() : mixed
Return values
mixed —postCreate()
Performs actions after data is created in the data source.
public
postCreate() : mixed
This method is a hook for executing custom logic after the data has been stored for a new element.
It is called by the parent Element's processData('postCreate')
method.
Return values
mixed —postDelete()
Performs actions after data is deleted from the data source.
public
postDelete() : mixed
This method is a hook for executing custom logic after the data has been removed for an element.
It is called by the parent Element's processData('postDelete')
method.
Tags
Return values
mixed —postRead()
Performs actions after data is read from the data source.
public
postRead() : mixed
This method is a hook for executing custom logic after the data has been fetched or read.
It is called by the parent Element's processData('postRead')
method.
Return values
mixed —postSearch()
Performs actions after a search is executed on the data source.
public
postSearch() : mixed
This method is a hook for executing custom logic after search criteria have been applied.
It is called by the parent Element's processData('postSearch')
method.
Tags
Return values
mixed —postUpdate()
Performs actions after data is updated in the data source.
public
postUpdate() : mixed
This method is a hook for executing custom logic after the data has been updated for an existing element.
It is called by the parent Element's processData('postUpdate')
method.
Tags
Return values
mixed —preCreate()
Performs actions before data is created in the data source.
public
preCreate() : mixed
This method is a hook for executing custom logic before the data is stored for a new element.
Return values
mixed —preDelete()
Performs actions before data is deleted from the data source.
public
preDelete() : mixed
This method is a hook for executing custom logic before the data is removed for an element.
Return values
mixed —preRead()
Performs actions before data is read from the data source.
public
preRead() : mixed
This method is a hook for executing custom logic before the data is fetched or read.
Return values
mixed —preSearch()
Performs actions before a search is executed on the data source.
public
preSearch() : mixed
This method is a hook for executing custom logic before search criteria are applied.
Return values
mixed —preUpdate()
Performs actions before data is updated in the data source.
public
preUpdate() : mixed
This method is a hook for executing custom logic before the data is updated for an existing element.
Return values
mixed —processElementCreate()
public
processElementCreate() : mixed
Return values
mixed —refreshElementSelect()
public
refreshElementSelect(mixed $tagId) : mixed
Parameters
- $tagId : mixed
Return values
mixed —renderer()
Gets or sets the renderer for this Data object.
public
renderer([SR_htmlJQuery|null $renderer = null ]) : SR_htmlJQuery
If no renderer is set for this Data object, it attempts to get the renderer from its parent Element. If no parent or renderer is found, it defaults to the global renderer.
Parameters
- $renderer : SR_htmlJQuery|null = null
-
Optional. The renderer instance to set. If null, the current renderer is returned.
Return values
SR_htmlJQuery —The renderer instance.
showCreate()
Generates the input field for creating a new data entry.
public
showCreate() : mixed
This method provides the interface item element required for capturing the data when creating a new element. Returns the appropriate input field for creation.
Return values
mixed —The input element for creation.
showDelete()
Generates the output for displaying the data in a deletion context.
public
showDelete() : mixed
This method is used to render the data when an element is being prepared for deletion. Child classes should override this method to provide a specific representation for deletion.
Return values
mixed —The rendered output for deletion.
showElementCreate()
public
showElementCreate(mixed $tagId, mixed $inputName) : mixed
Parameters
- $tagId : mixed
- $inputName : mixed
Return values
mixed —showElementSelect()
public
showElementSelect(mixed $tagId, mixed $inputName) : mixed
Parameters
- $tagId : mixed
- $inputName : mixed
Return values
mixed —showEmbeded()
Displays the data in an embedded context.
public
showEmbeded([mixed $template = null ]) : mixed
This method is used when the data is displayed as part of another element. Returns the formatted value appropriate for embedding.
Parameters
- $template : mixed = null
Return values
mixed —The rendered output for embedding.
showEmbededSearchInput()
public
showEmbededSearchInput() : mixed
Return values
mixed —showEmbededStrip()
Returns a stripped-down, embedded representation of the Data value.
public
showEmbededStrip([mixed $template = null ]) : mixed
By default, this returns the raw value. Child classes can override this for specific formatting.
Parameters
- $template : mixed = null
Return values
mixed —The stripped-down embedded value.
showEmbededUpdateInput()
function showEmbededUpdateInput - this function works after function showInput, after have listed or added new values you can edit them or delete them without modify the original values and put the HTML to do it.
public
showEmbededUpdateInput() : string
Return values
string —showList()
Displays the data for a list view.
public
showList() : mixed
This method is used to render the data when multiple elements are displayed in a list or table. Returns the formatted value appropriate for a list view.
Return values
mixed —The rendered output for listing.
showSearch()
Generates the input field or display for searching based on this data.
public
showSearch() : mixed
This method is used to create the form element or display representation for searching. Returns the appropriate input field or display for searching.
Return values
mixed —The input element or display for searching.
showUpdate()
Generates the input field for updating an existing data entry.
public
showUpdate() : mixed
This method provides the interface item element required for modifying the data of an existing element. Returns the appropriate input field for updating, potentially pre-filled with the current value.
Return values
mixed —The input element for updating.
showView()
Displays the data for a single item view.
public
showView([mixed $template = null ]) : mixed
This method is typically used to render the data in a detailed view of an element. Returns the formatted value appropriate for a detailed view.
Parameters
- $template : mixed = null
Return values
mixed —The rendered output for viewing.
val()
Gets or sets the value of the Data object.
public
val([mixed $val = null ]) : mixed
If a value is provided, it attempts to set it after validation, unless the value is fixed. If no value is provided, it returns the current value.
Parameters
- $val : mixed = null
-
Optional. The value to set. Defaults to null.
Return values
mixed —The current value of the Data object if no value is provided for setting.
viewVal()
Returns the value of the Data object for viewing.
public
viewVal() : mixed
This method provides the raw value suitable for simple display.
Return values
mixed —The current value of the Data object.