SD_Password
extends SD_String
in package
Password data type
This is a password data type which allow you create an input to introduce a password and other input to confirm it.
Tags
Table of Contents
- $autoIncrement : bool
- $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
- $encriptedFlag : bool
- $fetch : bool
- indicates if the SimplOndata must have a value in order to allow the storage of it's dataParent SimplOnelement
- $filterCriteria : bool
- 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
- $printValInInput : mixed
- $renderer : SR_htmlJQuery
- $renderOverride : mixed
- $required : bool
- $search : bool
- $tip : mixed
- $tipInline : mixed
- $update : bool
- indicates if the SimplOndata must be used in the update from
- $val : mixed
- Data value
- $validationCurrent : bool
- $validationMatch : bool
- $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
- Constructs a new SC_Data instance.
- __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() : mixed
- doDelete() : mixed
- Performs actions during a delete operation.
- doRead() : mixed
- It's important to distinguish between encrypted (from DB) and unencrypted (from User form and some of calls to ->val($val) ) values.
- doSearch() : mixed
- doUpdate() : 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
- postCreate() : mixed
- postDelete() : mixed
- postRead() : mixed
- postSearch() : mixed
- postUpdate() : mixed
- preCreate() : mixed
- preDelete() : mixed
- preRead() : mixed
- preSearch() : mixed
- preUpdate() : mixed
- readFromDB() : an
- function readFromDB - this function return a element from database to be read without modify the other element's database that have been introduced
- 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() : string
- function val - This function verifies if the passwords introduced are the same and if it's not throw an exception and if it's true store the password into the database.
- viewVal() : mixed
- Returns the value of the Data object for viewing.
Properties
$autoIncrement
protected
bool
$autoIncrement
= 'name == :name'
- this variable indicates if the value introduced will be encrypted or is encrupted or not.
$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
= 'name == :name'
- this variable indicates if the value introduced will be encrypted or is encrupted or not.
$encriptedFlag
protected
bool
$encriptedFlag
= 'name == :name'
- this variable indicates if the value introduced will be encrypted or is encrupted or not.
$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
bool
$filterCriteria
= 'name == :name'
- this variable indicates if the value introduced will be encrypted or is encrupted or not.
$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
= 'name == :name'
- this variable indicates if the value introduced will be encrypted or is encrupted or not.
$name
protected
mixed
$name
= \true
$parent
protected
SC_Element
$parent
= \true
$printValInInput
protected
mixed
$printValInInput
= \true
$renderer
protected
SR_htmlJQuery
$renderer
= \true
$renderOverride
protected
mixed
$renderOverride
= \true
$required
protected
bool
$required
= 'name == :name'
- this variable indicates if the value introduced will be encrypted or is encrupted or not.
$search
protected
bool
$search
= 'name == :name'
- this variable indicates if the value introduced will be encrypted or is encrupted or not.
$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
$validationCurrent
protected
bool
$validationCurrent
= 'name == :name'
- this variable indicates if the value introduced will be encrypted or is encrupted or not.
$validationMatch
protected
bool
$validationMatch
= 'name == :name'
- this variable indicates if the value introduced will be encrypted or is encrupted or not.
$validationRequired
protected
mixed
$validationRequired
= \true
$view
indicates if the SimplOndata must be used when generating the default HTML template
protected
bool
$view
= 'name == :name'
- this variable indicates if the value introduced will be encrypted or is encrupted or not.
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([string|null $label = null ][, string|null $flags = null ][, mixed $val = null ][, string|null $filterCriteria = 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
- $label : string|null = null
-
Human readable description of the attribute, intended to appear in forms and tables. Defaults to null.
- $flags : string|null = null
-
VCUSRLF flags indicating where the Data will be used within an Element. dataFlags. Defaults to null.
- $val : mixed = null
-
If provided, sets the initial value of the data. Defaults to null.
- $filterCriteria : string|null = null
-
Determines how the data value will be compared/evaluated in queries to the Data Storage. Defaults to 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()
public
doCreate() : mixed
Return values
mixed —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()
It's important to distinguish between encrypted (from DB) and unencrypted (from User form and some of calls to ->val($val) ) values.
public
doRead() : mixed
All the operations regarding altering the DB will check for encription and make it before interacting with the DB. When reading from the DB, the encriptedFlag will be set to true, other interactions will have to check and set the flag.
Return values
mixed —doSearch()
public
doSearch() : mixed
Return values
mixed —doUpdate()
public
doUpdate() : mixed
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 —postCreate()
public
postCreate() : mixed
Return values
mixed —postDelete()
public
postDelete() : mixed
Return values
mixed —postRead()
public
postRead() : mixed
Return values
mixed —postSearch()
public
postSearch() : mixed
Return values
mixed —postUpdate()
public
postUpdate() : mixed
Return values
mixed —preCreate()
public
preCreate() : mixed
Return values
mixed —preDelete()
public
preDelete() : mixed
Return values
mixed —preRead()
public
preRead() : mixed
Return values
mixed —preSearch()
public
preSearch() : mixed
Return values
mixed —preUpdate()
public
preUpdate() : mixed
Return values
mixed —readFromDB()
function readFromDB - this function return a element from database to be read without modify the other element's database that have been introduced
public
readFromDB() : an
Return values
an —element array
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()
function val - This function verifies if the passwords introduced are the same and if it's not throw an exception and if it's true store the password into the database.
public
val([string $val = null ]) : string
Parameters
- $val : string = null
Tags
Return values
string —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.