SimplOn PHP
 All Data Structures Namespaces Files Functions Variables
Public Member Functions | Data Fields | Protected Attributes
Element Class Reference
+ Inheritance diagram for Element:

Public Member Functions

 __construct ($id_or_array=null, $storage=null, $specialDataStorage=null)
 construct ($id_or_array=null, &$specialDataStorage=null)
 field_id ($val=null)
 parent (&$parent=null)
 __call ($name, $arguments)
 htmlClasses ($append= '', $nestingLevel=null)
 cssSelector ($append= '', $nestingLevel=null)
 fillFromArray (&$array_of_data)
 requiredCheck ($array=array())
 fillFromRequest ()
 fillFromPost ()
 fillFromDSById ($id=null)
 save ()
 create ()
 update ()
 delete ()
 validateForDB ()
 processCreate ($nextStep=null)
 processUpdate ($nextStep=null)
 processDelete ($nextStep=null, $format= 'json')
 processSearch ()
 processSelect ()
 processAdmin ()
 defaultFilterCriteria ($operator= 'AND')
 filterCriteria ($filterCriteria=null)
 deleteCriteria ($deleteCriteria=null)
 defaultDeleteCriteria ($operator= 'AND')
 assignAsDatasParent (&$parent=null)
 assignDatasName ()
 index ()
 showCreate ($template_file=null, $action=null, $parentClass=null)
 showUpdate ($template_file=null, $action=null)
 showView ($template_file=null, $partOnly=false)
 showDelete ($template_file=null, $action=null)
 callDataMethod ($dataName, $method, array $params=array())
 showSearch ($template_file=null, $action=null)
 addOnTheFlyAttribute ($attributeName, $attribute=null)
 addOnTheFlyAttributes ()
 clearValues ($clearID=false)
 showSelect ($template_file=null, $action=null, $previewTemplate=null, $sid=null)
 showAdmin ($template_file=null, $add_html=array(), $partOnly=false)
 obtainHtml ($caller_method, $template=null, $action=null, $add_html=array(), $partOnly=false)
 getJS ($method, $returnFormat= 'array', $compress=false)
 getCSS ($method, $returnFormat= 'array', $compress=false)
 showMultiPicker ()
 getId ()
 setId ($id)
 encodeURL (array $construct_params=array(), $method=null, array $method_params=array())
 templateFilePath ($show_type, $alternative= '', $short=false, $template_type= 'html')
 toArray ()
 processData ($method)
 nestingLevel ($nestingLevel=null)
 dataAttributes ()
 attributesTypes ($type= '\\SimplOn\\Datas\\Data')
 attributesTypesWith ($type= '\\SimplOn\\Datas\\Data', $what='fetch')
 datasWith ($what)
 allow ($user, $method)

Data Fields

 $quickDelete

Protected Attributes

 $field_id
 $dataStorage
 $storage
 $filterCriteria
 $deleteCriteria
 $nestingLevel = 1
 $parent
 $storageChecked
 $excetionsMessages = array()
 $dataAttributes
 $formMethods = array('create', 'update', 'delete', 'search')
 $allowAll = false
 $permissions

Detailed Description

This is the core element to build the site. Elements are the way to indicate the system all data that conforms it. Each Element represents a data set.

In practical terms Elements are just Objets with extended capabilities to handle some common tasks like: Print their contents, Store their contents, find and retrieve the proper data from a dataStorage, etc.

Elements are programmed and used like any other regular object except that, in order to make their special features work, some of their attributes must be SimplON Data objects.

Author:
RSL

Definition at line 39 of file Element.php.


Constructor & Destructor Documentation

__construct ( id_or_array = null,
storage = null,
specialDataStorage = null 
)
  • Calls user defined constructor.
  • Adds default Element's actions.
  • Validates DataStorages.
  • Fills its Datas' values if possible (requires a valid ID or array of values).
  • Fills some of its Datas' meta-datas (parent, names).
    Parameters:
    mixed$id_or_arrayID of the Element or array of Element's Datas values.
    DataStorage$specialDataStorageDataStorage to use in uncommon cases.

Reimplemented in CSS, and JS.

Definition at line 130 of file Element.php.


Member Function Documentation

__call ( name,
arguments 
)

Allows some simplicity for coding and declarations, auto makes getters and setters so that any Data’s attribute value data->val() can be transparently accessed as a normal element attribute by Element->data(); and load all other BasicObject SimplON functionality

See also:
SimplOn.BaseObject::__call()

Reimplemented from BaseObject.

Definition at line 243 of file Element.php.

addOnTheFlyAttribute ( attributeName,
attribute = null 
)

Definition at line 747 of file Element.php.

Definition at line 759 of file Element.php.

allow ( user,
method 
)

Definition at line 1171 of file Element.php.

assignAsDatasParent ( &$  parent = null)

Sets the current instance the as "logical" parent of the Datas. Thus the datas may access other element's datas and methods if requeired Comments: This is useful in many circumstances for example it enables the existence of ComplexData.

See also:
ComplexData

Definition at line 668 of file Element.php.

Sets each Data it’s attribute name within the element instance.

Comment: Usefull to the generate and handle the filtercriteria

Definition at line 688 of file Element.php.

attributesTypes ( type = '\\SimplOn\\Datas\\Data')

Definition at line 1138 of file Element.php.

attributesTypesWith ( type = '\\SimplOn\\Datas\\Data',
what = 'fetch' 
)

Definition at line 1148 of file Element.php.

callDataMethod ( dataName,
method,
array $  params = array() 
)

Definition at line 738 of file Element.php.

clearValues ( clearID = false)

Definition at line 774 of file Element.php.

construct ( id_or_array = null,
&$  specialDataStorage = null 
)

User defined constructor, called within __constructor(), useful to declare specific Data attributes.

Parameters:
mixed$id_or_arrayID of the Element or array of Element's Datas values.
SimplOn\DataStorages\DataStorage$specialDataStorageDataStorage to use in uncommon cases.

Reimplemented in User.

Definition at line 194 of file Element.php.

create ( )

Definition at line 389 of file Element.php.

cssSelector ( append = '',
nestingLevel = null 
)

Definition at line 291 of file Element.php.

Definition at line 1130 of file Element.php.

datasWith ( what)

Definition at line 1159 of file Element.php.

defaultDeleteCriteria ( operator = 'AND')

Definition at line 647 of file Element.php.

defaultFilterCriteria ( operator = 'AND')

Definition at line 573 of file Element.php.

delete ( )

Definition at line 407 of file Element.php.

deleteCriteria ( deleteCriteria = null)

Definition at line 622 of file Element.php.

encodeURL ( array $  construct_params = array(),
method = null,
array $  method_params = array() 
)

Definition at line 1068 of file Element.php.

field_id ( val = null)
Todo:

check why this can't be changed by $this->field_id = $this->attributesTypes('\SimplOn\Datas\Id'); $this->field_id = $this->field_id[0]; at the _construct Method

Change the hole field_id concept from string to array

Parameters:
type$val
Returns:
type

Definition at line 211 of file Element.php.

fillFromArray ( &$  array_of_data)

Assigns to each Data attribute it's corresponding value from an array of values.

Parameters:
array$array_of_data

Definition at line 303 of file Element.php.

fillFromDSById ( id = null)

Retrieves the element's Datas values from the DataSotarage, using the recived Id or the element's id if no id is provided.

Parameters:
mixed$idthe id of the element whose data we whant to read from de DS
Exceptions:
Exception
Todo:
: in arrays format ????

Definition at line 370 of file Element.php.

Definition at line 352 of file Element.php.

NOTE: This method is not a simple redirection to $this->fillFromArray($_REQUEST) because the file upload requeires the $_FILES array Thus the redirection from fillFromRequest to fillFromArray is made at the SimplOnData and there for any SimplOnData that needs to distinguish between both can do it.

COMPLETE THE PART TO HANDLE FILES

Definition at line 343 of file Element.php.

filterCriteria ( filterCriteria = null)

????????????????????

Possible labels: name to refer to a data name; .name to refer to a data filterCriteria; :name to refer to a data value; "values" to specify a hard-coded value.

Definition at line 593 of file Element.php.

getCSS ( method,
returnFormat = 'array',
compress = false 
)

Definition at line 1007 of file Element.php.

getId ( )

Definition at line 1054 of file Element.php.

getJS ( method,
returnFormat = 'array',
compress = false 
)

Definition at line 964 of file Element.php.

htmlClasses ( append = '',
nestingLevel = null 
)

Definition at line 286 of file Element.php.

index ( )

Default method that will be shown in case no methods have been specified.

Reimplemented in Search, CSS, and JS.

Definition at line 710 of file Element.php.

nestingLevel ( nestingLevel = null)

Definition at line 1114 of file Element.php.

obtainHtml ( caller_method,
template = null,
action = null,
add_html = array(),
partOnly = false 
)
Todo:
change the way HTL is filled instead of cicle triugh the datas and filling the template cicle trough the template and run elment's or data's methods as required.

Definition at line 819 of file Element.php.

parent ( &$  parent = null)

Definition at line 227 of file Element.php.

Definition at line 563 of file Element.php.

processCreate ( nextStep = null)

Definition at line 425 of file Element.php.

processData ( method)

Applies a method to all the Datas and returns an array containing all the responses.

Parameters:
string$methodmust be a method common to all datas

Definition at line 1099 of file Element.php.

processDelete ( nextStep = null,
format = 'json' 
)

Definition at line 485 of file Element.php.

Definition at line 520 of file Element.php.

Definition at line 550 of file Element.php.

processUpdate ( nextStep = null)

Definition at line 456 of file Element.php.

requiredCheck ( array = array())

Definition at line 320 of file Element.php.

save ( )

Definition at line 383 of file Element.php.

setId ( id)

Definition at line 1059 of file Element.php.

showAdmin ( template_file = null,
add_html = array(),
partOnly = false 
)

Definition at line 798 of file Element.php.

showCreate ( template_file = null,
action = null,
parentClass = null 
)

Definition at line 718 of file Element.php.

showDelete ( template_file = null,
action = null 
)

Definition at line 731 of file Element.php.

Definition at line 1046 of file Element.php.

showSearch ( template_file = null,
action = null 
)

Definition at line 743 of file Element.php.

showSelect ( template_file = null,
action = null,
previewTemplate = null,
sid = null 
)

Definition at line 789 of file Element.php.

showUpdate ( template_file = null,
action = null 
)

Definition at line 723 of file Element.php.

showView ( template_file = null,
partOnly = false 
)

Definition at line 727 of file Element.php.

templateFilePath ( show_type,
alternative = '',
short = false,
template_type = 'html' 
)

Definition at line 1075 of file Element.php.

toArray ( )

Returns an array representation of the Element assigning each Data's name as the key and the data's value as the value.

Returns:
array

Definition at line 1087 of file Element.php.

update ( )

Definition at line 400 of file Element.php.

Definition at line 418 of file Element.php.


Field Documentation

$allowAll = false [protected]

Definition at line 113 of file Element.php.

$dataAttributes [protected]

Definition at line 103 of file Element.php.

$dataStorage [protected]

Definition at line 55 of file Element.php.

$deleteCriteria [protected]

Definition at line 71 of file Element.php.

$excetionsMessages = array() [protected]

Definition at line 92 of file Element.php.

$field_id [protected]

Definition at line 49 of file Element.php.

$filterCriteria [protected]

Definition at line 69 of file Element.php.

$formMethods = array('create', 'update', 'delete', 'search') [protected]

Definition at line 108 of file Element.php.

$nestingLevel = 1 [protected]

Definition at line 79 of file Element.php.

$parent [protected]

Reimplemented in Search.

Definition at line 81 of file Element.php.

$permissions [protected]
Initial value:
 array(
        'aa'=>array(),
        
    )

Definition at line 115 of file Element.php.

$quickDelete

Definition at line 94 of file Element.php.

$storage [protected]

Definition at line 62 of file Element.php.

$storageChecked [protected]

Definition at line 90 of file Element.php.


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