phpDocumentor CCL
[ class tree: CCL ] [ index: CCL ] [ all elements ]

Class: Param

Source Location: /Param.php

Class Param

Descendants
Child Class Description
Textarea Message text parameter class
Enum Enumeration (ENUM) parameter class
Reference A reference parameter in terms of relational database design
DateTimeStamp Date parameter class. In Cotonti all date/time types are UNIX timestamps inside.
DateStamp Date parameter class. In Cotonti all date/time types are UNIX timestamps inside

[ Top ]
Property Summary
bool   $allow_html   For string parameters only
mixed   $default   Optional default value
bool   $display  
string   $hint   Used on display in forms
string   $input_class   Optional class attribute for XHTML input
string   $name  
bool   $primary_key  
bool   $required   A user must specify this parameter non-empty
string   $title  
int   $type  

[ Top ]
Method Summary
Param   __construct()   Constructs parameter object
mixed   cast()   Casts a value due to parameter type
string   display()   Renders param value display in a correct way
string   display_input()   Renders param input display in a correct way
mixed   import()   Imports parameter value from user input
mixed   prepare()   Prepares a parameter value for use in database statement

[ Top ]
Properties
bool   $allow_html = FALSE [line 84]

For string parameters only

API Tags:
Access:  public


[ Top ]
mixed   $default = NULL [line 74]

Optional default value

API Tags:
Access:  public


[ Top ]
bool   $display = TRUE [line 60]
API Tags:
Access:  public


[ Top ]
string   $hint = '' [line 79]

Used on display in forms

API Tags:
Access:  public


[ Top ]
string   $input_class = NULL [line 89]

Optional class attribute for XHTML input

API Tags:
Access:  public


[ Top ]
string   $name [line 52]
API Tags:
Access:  public


[ Top ]
bool   $primary_key = FALSE [line 56]
API Tags:
Access:  public


[ Top ]
bool   $required = FALSE [line 69]

A user must specify this parameter non-empty

API Tags:
Access:  public


[ Top ]
string   $title [line 64]
API Tags:
Access:  public


[ Top ]
int   $type [line 48]
API Tags:
Access:  public


[ Top ]
Methods
Constructor __construct  [line 101]

  Param __construct( int $type, string $name, [bool $display = TRUE], [bool $required = FALSE], [bool $primary_key = FALSE]  )

Constructs parameter object

Parameters:
int   $type:  Param_type
string   $name:  Parameter name
bool   $display:  Render it in templates
bool   $required:  Require it from user input
bool   $primary_key:  Is primary key of the entity

API Tags:
Access:  public


Redefined in descendants as:

[ Top ]
cast  [line 141]

  mixed cast( mixed $value  )

Casts a value due to parameter type

Parameters:
mixed   $value:  Raw value

API Tags:
Return:  Casted value
Access:  public


[ Top ]
display  [line 252]

  string display( mixed $value  )

Renders param value display in a correct way

Parameters:
mixed   $value: 

API Tags:
Return:  Rendered display element
See:  Param::display_input(), Param::title, Param::hint
Access:  public


Redefined in descendants as:

[ Top ]
display_input  [line 273]

  string display_input( [mixed $value = NULL], [string $prefix = '']  )

Renders param input display in a correct way

Parameters:
mixed   $value: 
string   $prefix:  Input name prefix

API Tags:
See:  Param::display(), Param::title, Param::hint
Access:  public


Redefined in descendants as:

[ Top ]
import  [line 188]

  mixed import( [string $method = 'P'], [string $prefix = '']  )

Imports parameter value from user input

Parameters:
string   $method:  Request method: P - post, G - get.
string   $prefix:  Input name prefix

API Tags:
Return:  Value on success or NULL if validation failed
Access:  public


Redefined in descendants as:

[ Top ]
prepare  [line 165]

  mixed prepare( mixed $value  )

Prepares a parameter value for use in database statement

Parameters:
mixed   $value:  Source value

API Tags:
Return:  Prepared value
Access:  public


Redefined in descendants as:
  • Set::prepare() : Prepares a parameter value for use in database statement

[ Top ]

Documentation generated on Thu, 09 Jul 2009 14:11:35 +0400 by phpDocumentor 1.4.1