Stud.IP  4.0
 All Data Structures Namespaces Files Functions Variables Groups
Input Class Reference
Inheritance diagram for Input:
CalculatorInput CheckboxInput DatetimepickerInput HiddenInput I18n_formattedInput I18n_textareaInput I18n_textInput MultiselectInput NewsRangesInput NoInput NumberInput QuicksearchInput RangeInput SelectInput TextareaInput TextInput

Public Member Functions

 __construct ($name, $title, $value, array $attributes=[])
 
 setParent (Part $parent)
 
 getParent ()
 
 dataMapper ($value)
 
 getName ()
 
 getValue ()
 
 getAllInputNames ()
 
 renderWithCondition ()
 
 render ()
 
 getContextObject ()
 
 setMapper (Callable $callback)
 
 setStoringFunction (Callable $store)
 
 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
 
 $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 (   $name,
  $title,
  $value,
array  $attributes = [] 
)
final

Constructor of the Input class.

Parameters
$name
$title
$value
$attributes

Member Function Documentation

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 (   $value)
extractOptionsFromAttributes ( array &  $attributes)
protected
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 ( )

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

Returns
null|
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
$object,:most likely a SimpleORMap object.
Returns
array
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 ( )

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

Returns
null|Part
getRequestValue ( )

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

Returns
string|null
getValue ( )

Returns the value of this input.

Returns
null
render ( )
abstract

This renders the Input.

Returns
string
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 (   $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 ( 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 ( 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 ( bool  $permission)

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

Parameters
boolean$if
Returns
$this
setRequired (   $required = true)

Marks the input as a required field.

Parameters
$required
Returns
$this
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

Field Documentation

$attributes = []
protected
$if = null
$mapper = null
$name = null
protected
$parent = null
protected
$permission = true
$required = false
$store = null
$title = null
protected
$value = null
protected

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