Stud.IP  5.4
Input Class Reference
Inheritance diagram for Input:
CalculatorInput CaptchaInput CheckboxInput ConfirmInput DatalistInput DatetimepickerInput HiddenInput I18n_formattedInput I18n_textareaInput I18n_textInput InfoInput MultiselectInput NewsRangesInput NoInput NumberInput PasswordInput QuicksearchInput RadioInput RangeInput SelectedRangesInput SelectInput TextareaInput TextInput WysiwygInput

Public Member Functions

 __construct ($name, $title, $value, array $attributes=[])
 
 setParent (Part $parent)
 
 getParent ()
 
 dataMapper ($value)
 
 getName ()
 
 getTitle ()
 
 hasValidation ()
 
 getValidationCallback ()
 
 getValue ()
 
 getAllInputNames ()
 
 renderWithCondition ()
 
 render ()
 
 getContextObject ()
 
 setMapper (Callable $callback)
 
 setStoringFunction (Callable $store)
 
 setValidationFunction (Callable $validate)
 
 setIfCondition ($if)
 
 setPermission (bool $permission)
 
 setRequired ($required=true)
 
 getRequestValue ()
 

Static Public Member Functions

static create ($name, $title, $value, array $attributes=[])
 
static getFielddataFromMeta ($meta, $object)
 

Data Fields

 $mapper = null
 
 $store = null
 
 $validate = null
 
 $if = null
 
 $permission = true
 
 $required = false
 

Protected Member Functions

 extractOptionsFromAttributes (array &$attributes)
 

Protected Attributes

 $title = null
 
 $value = null
 
 $attributes = []
 
 $name = null
 
 $parent = null
 

Constructor & Destructor Documentation

◆ __construct()

__construct (   $name,
  $title,
  $value,
array  $attributes = [] 
)
final

Constructor of the Input class.

Parameters
$name
$title
$value
$attributes

Member Function Documentation

◆ create()

static create (   $name,
  $title,
  $value,
array  $attributes = [] 
)
static

A static constructor. Returns a new Input-object.

Parameters
string$name
string$title
mixed$value
array$attributes
Returns
static

◆ dataMapper()

dataMapper (   $value)

◆ extractOptionsFromAttributes()

extractOptionsFromAttributes ( array &  $attributes)
protected

◆ getAllInputNames()

getAllInputNames ( )

Returns an array with all names of all inputs that this Input-object has. Normally this is just one name because there is only one input. But if you think of i18n-inputs there are possibly more textareas - one for each language. In that case this function would return all names of all inputs that are present.

Returns
string[]

◆ getContextObject()

getContextObject ( )

Returns the context-object which is usually a SimpleORMap object.

Returns
null|

◆ getFielddataFromMeta()

static getFielddataFromMeta (   $meta,
  $object 
)
static

This static method returns fielddata as an array from metadata of a database-field. This array will be used internally to create the best fitting Input object to the database field.

Parameters
array$meta
$objectmost likely a SimpleORMap object.
Returns
array

◆ getName()

getName ( )

Returns the name of the given input. Also have a look at the method getAllInputNames if you want to provide multiple input elements (like in i18n input fields) within one virtual input. In that case this getName method returns the main-input name like the attribute in the SORM class.

Returns
null

◆ getParent()

getParent ( )

Returns the parent of this Input if there is already one.

Returns
null|Part

◆ getRequestValue()

getRequestValue ( )

Returns the values from the request. Normally this is ::get, but special Input-classes could also return arrays or objects.

Returns
string|null

◆ getTitle()

getTitle ( )

◆ getValidationCallback()

getValidationCallback ( )

◆ getValue()

getValue ( )

Returns the value of this input. If $this->value is a callable this->getValue() returns the computed result.

Returns
mixed

◆ hasValidation()

hasValidation ( )

◆ render()

render ( )
abstract

This renders the Input.

Returns
string

◆ renderWithCondition()

renderWithCondition ( )

Renders the Input but maybe encapsulated in a template that is displayed only if a condition is true. This is helpful for the if-attribute on the Input like in setIfCondition.

Returns
string

◆ setIfCondition()

setIfCondition (   $if)

Sets a condition to display this input. The condition is a javascript condition which is used by vue to hide the input if the condition is not satisfies.

Parameters
string$if
Returns
$this

◆ setMapper()

setMapper ( Callable  $callback)

Sets a special mapper-function to turn the request-values into the real values for the database.

Parameters
callable$callback
Returns
$this

◆ setParent()

setParent ( Part  $parent)

Sets the parent of this Input object. Usually this is done automatically by the framework in the moment that the input is initialized in the Form object. So you usually don't need to call this method on your own.

Parameters
Part$parent
Returns
$this

◆ setPermission()

setPermission ( bool  $permission)

Set if the user is able to see and edit this input

Parameters
boolean$if
Returns
$this

◆ setRequired()

setRequired (   $required = true)

Marks the input as a required field.

Parameters
$required
Returns
$this

◆ setStoringFunction()

setStoringFunction ( Callable  $store)

Sets the storing function. This would override the normal storing-function that just sets the value of a given context object like a SORM object.

Parameters
callable$store
Returns
$this

◆ setValidationFunction()

setValidationFunction ( Callable  $validate)

Sets the server-side verify function of this input. The callable returns true if the given value is okay, or false or a textstring representing the error.

Parameters
callable$verify
Returns
$this

Field Documentation

◆ $attributes

$attributes = []
protected

◆ $if

$if = null

◆ $mapper

$mapper = null

◆ $name

$name = null
protected

◆ $parent

$parent = null
protected

◆ $permission

$permission = true

◆ $required

$required = false

◆ $store

$store = null

◆ $title

$title = null
protected

◆ $validate

$validate = null

◆ $value

$value = null
protected

The documentation for this class was generated from the following file: