SD_File
extends SD_String
in package
String data type
This is a string data type which allow you show an input to introduce a string.
Table of Contents
- $autoIncrement : mixed
- $create : bool
- indicates if the SimplOndata must be used in the add(capture) from
- $delete : bool
- RSL 2022 aded "e Emebded" indicates if the SimplOndata must bre printed when deliting the element
- $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
- $fileName : mixed
- $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)
- $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
- $path : 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
- $search : bool
- indicates if the SimplOndata must be used in the search from
- $tip : mixed
- $tipInline : mixed
- $update : bool
- indicates if the SimplOndata must be used in the update from
- $val : mixed
- Data value
- $validationRequired : mixed
- $view : bool
- indicates if the SimplOndata must be used when generating the default HTML template
- __call() : mixed
- Auto Makes the Setters and Getters
- __construct() : mixed
- __toString() : string
- Tells PHP how to render this object as a string
- 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() : mixed
- fileName() : mixed
- filterCriteria() : mixed
- fixValue() : mixed
- Sets and fixes the value of the Data object, preventing further changes.
- getClass() : string
- Returns the object's class
- hasAttribute() : bool
- Checks if a an object has a specific method
- hasProperty() : bool
- Checks if a an object has a specific property
- 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.
- ObjectId() : mixed
- Class and instance id
- path() : 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.
- renderer() : SR_htmlJQuery
- Gets or sets the renderer for this Data object.
- showCreate() : mixed
- showDelete() : mixed
- showEmbeded() : mixed
- Displays the data in an embedded context.
- showEmbededStrip() : mixed
- Returns a stripped-down, embedded representation of the Data value.
- showList() : mixed
- Displays the data for a list view.
- showSearch() : mixed
- showUpdate() : mixed
- showView() : mixed
- Displays the data for a single item view.
- val() : mixed
- viewVal() : mixed
- Returns the value of the Data object for viewing.
Properties
$autoIncrement
protected
mixed
$autoIncrement
= \true
$create
indicates if the SimplOndata must be used in the add(capture) from
protected
bool
$create
= \true
$delete
RSL 2022 aded "e Emebded" indicates if the SimplOndata must bre printed when deliting the element
protected
bool
$delete
= \true
$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
$fileName
protected
mixed
$fileName
= \null
$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
$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
protected
SC_Element
$parent
= \true
$path
protected
mixed
$path
= \null
$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
$search
indicates if the SimplOndata must be used in the search from
protected
bool
$search
= \true
$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
$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
Methods
__call()
Auto Makes the Setters and Getters
public
__call( $name, $arguments) : mixed
Parameters
Return values
mixed —__construct()
public
__construct([mixed $path = './files' ][, mixed $label = null ][, mixed $flags = null ][, mixed $val = null ][, mixed $filterCriteria = null ]) : mixed
Parameters
- $path : mixed = './files'
- $label : mixed = null
- $flags : mixed = null
- $val : mixed = null
- $filterCriteria : mixed = null
Return values
mixed —__toString()
Tells PHP how to render this object as a string
public
__toString() : string
Return values
string —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.
Tags
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.
Tags
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.
Tags
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()
public
doUpdate() : mixed
Return values
mixed —fileName()
public
fileName([mixed $fileName = null ]) : mixed
Parameters
- $fileName : mixed = null
Return values
mixed —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.
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 —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.
ObjectId()
Class and instance id
public
ObjectId() : mixed
Return values
mixed —path()
public
path([mixed $path = null ]) : mixed
Parameters
- $path : mixed = null
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.
Tags
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.
Tags
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 —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()
public
showCreate() : mixed
Return values
mixed —showDelete()
public
showDelete() : mixed
Return values
mixed —showEmbeded()
Displays the data in an embedded context.
public
showEmbeded() : mixed
This method is used when the data is displayed as part of another element. Returns the formatted value appropriate for embedding.
Return values
mixed —The rendered output for embedding.
showEmbededStrip()
Returns a stripped-down, embedded representation of the Data value.
public
showEmbededStrip() : mixed
By default, this returns the raw value. Child classes can override this for specific formatting.
Return values
mixed —The stripped-down embedded value.
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()
public
showSearch() : mixed
Return values
mixed —showUpdate()
public
showUpdate() : mixed
Return values
mixed —showView()
Displays the data for a single item view.
public
showView() : 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.
Return values
mixed —The rendered output for viewing.
val()
public
val([mixed $val = null ]) : mixed
Parameters
- $val : mixed = null
Return values
mixed —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.