Stud.IP  4.0
 All Data Structures Namespaces Files Functions Variables Groups
Form Class Reference
Inheritance diagram for Form:
Part

Public Member Functions

 __construct (...$parts)
 
 addSORM (\SimpleORMap $object, array $params=[])
 
 setURL ($url)
 
 getURL ()
 
 setCollapsable ($collapsing=true)
 
 isCollapsable ()
 
 autoStore ()
 
 isAutoStoring ()
 
 addAfterStoreCallback (Callable $c)
 
 setId ($id)
 
 getId ()
 
 store ()
 
 addPart (Part $part)
 
 getParts ()
 
 getLastPart ()
 
 render ()
 
- Public Member Functions inherited from Part
 __construct (...$parts)
 
 setContextObject ($object)
 
 getContextObject ()
 
 addPart (Part $part)
 
 addInput (Input $input)
 
 render ()
 
 renderWithCondition ()
 
 getAllInputs ()
 
 setParent (Part $parent)
 
 setIfCondition ($if)
 
 getInputFromArray (array $data)
 

Static Public Member Functions

static fromSORM (\SimpleORMap $object, $params=[], $url=null)
 
static create ()
 

Protected Member Functions

 getStoringCallback (Input $input)
 
 getStorableValueFromRequest (Input $input)
 

Protected Attributes

 $afterStore = []
 
 $inputs = []
 
 $parts = []
 
 $url = null
 
 $autoStore = false
 
 $collapsable = false
 
 $id = null
 
- Protected Attributes inherited from Part
 $parent = null
 
 $contextobject = null
 
 $parts = []
 

Additional Inherited Members

- Data Fields inherited from Part
 $if = null
 

Constructor & Destructor Documentation

__construct (   $parts)
final

Finalized constructor.

Parameters
mixed[]...$parts

Member Function Documentation

addAfterStoreCallback ( Callable  $c)

Adds a callback function that is executed right after the store-method. That callback receives this Form object as the only parameter.

Parameters
callable$c
Returns
Form $this
addPart ( Part  $part)

Adds a Part object to this form like a fieldset

Parameters
Part$part
Returns
Form|void
addSORM ( \SimpleORMap  $object,
array  $params = [] 
)

Adds a new Fieldset to the Form object with the SORM object's fields as input fields. These fields can be modified or specified by the $params array.

Parameters
\SimpleORMap$object
array$params
Returns
Form $this
autoStore ( )

Stores the Form object if this is a POST-request. This also erases the URL so that the auto-save URL will be set automatically to the current $_SERVER['REQUEST_URI'].

Returns
$this
Exceptions
\AccessDeniedException
static create ( )
static

A static constructor for an empty Form object.

Returns
Form
static fromSORM ( \SimpleORMap  $object,
  $params = [],
  $url = null 
)
static

Creates a new Form object from a SORM object so that each field of the db-table becomes an input-field of the form. You can modify the form by the params.

Parameters
\SimpleORMap$object
array$params
string | null$url
Returns
Form
getId ( )

Returns the ID if this form. This ID is only relevant for plugins to identify this Form object.

Returns
string|null
getLastPart ( )

Returns the last part of the form. If there is none yet, it will create a fieldset and return that.

Returns
Part
getParts ( )

Returns all the Part objects like Fieldsets as an array.

Returns
array
getStorableValueFromRequest ( Input  $input)
protected

Returns the value for the Input object from the $_REQUEST. This value will also be mapped by the Input's dataMapper function and after that by a special mapper-callback the Input probably has.

Parameters
Input$input
Returns
mixed
getStoringCallback ( Input  $input)
protected

Returns the function to be used to store the value into the input. If the given Input has no storing function it will generate a Closuer to set the value to the SimpleORMap context object.

Parameters
$input
Returns
|void
getURL ( )

Returns the URL where the Form is leading to after the submit.

Returns
string|null
isAutoStoring ( )
isCollapsable ( )
render ( )

Renders the whole form as a string.

Returns
string
Exceptions
\Flexi_TemplateNotFoundException
setCollapsable (   $collapsing = true)
setId (   $id)

Sets the ID if this form. This ID is only relevant for plugins to identify this Form object.

Parameters
string | null$id
Returns
Form $this
setURL (   $url)

Sets the URL where the Form should be leading after submitting.

Parameters
$url
Returns
Form $this
store ( )

Returns the number of storing processes

Returns
: a number of storing processes. 0 if nothing was stored.

Field Documentation

$afterStore = []
protected
$autoStore = false
protected
$collapsable = false
protected
$id = null
protected
$inputs = []
protected
$parts = []
protected
$url = null
protected

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