Class jControllerDaoCrud

Description

a base class for crud controllers

  • since: 1.0b3

Located in /controllers/jControllerDaoCrud.class.php (line 22)

jController
   |
   --jControllerDaoCrud
Variable Summary
Method Summary
void create ()
void delete ()
void editupdate ()
void index ()
void precreate ()
void preupdate ()
void savecreate ()
void saveupdate ()
void view ()
void _afterCreate (jFormsBase $form, mixed $id, jResponseHtml $resp)
void _afterUpdate (jFormsBase $form, mixed $id, jResponseHtml $resp)
boolean _checkDatas (jFormsBase $form, boolean $calltype)
void _create (jFormsBase $form, jResponseHtml $resp, jtpl $tpl)
boolean _delete (mixed $id, jResponseHtml $resp)
void _editUpdate (jFormsBase $form, jResponseHtml $resp, jtpl $tpl)
string _getAction (string $method)
void _index (jResponseHtml $resp, jtpl $tpl)
void _view (jFormsBase $form, jResponseHtml $resp, jtpl $tpl)
Variables
string $dao = '' (line 29)

selector of the dao to use for the crud.

It should be filled by child controller.

  • access: protected
mixed $dbProfil = '' (line 104)

the jDb profil to use with the dao

  • access: protected
string $editTemplate = 'jelix~crud_edit' (line 64)

template to display the form

  • access: protected
string $form = '' (line 36)

selector of the form to use to edit and display a record It should be filled by child controller.

  • access: protected
integer $listPageSize = 20 (line 76)

number of record to display in the list page

  • access: protected
string $listTemplate = 'jelix~crud_list' (line 58)

template to display the list of records

  • access: protected
string $offsetParameterName = 'offset' (line 89)

name of the parameter which contains the page offset, for the index action

  • access: protected
array $propertiesForList = array() (line 44)

list of properties to show in the list page if empty list (default), it shows all properties.

this property is only usefull when you use the default "list" template

  • access: protected
array $propertiesForRecordsOrder = array() (line 52)

list of properties which serve to order the record list

if empty list (default), the list is in a natural order keys are properties name, and values are "asc" or "desc"

  • access: protected
string $pseudoFormId = 'jelix_crud_roxor' (line 96)

id for the "pseudo" form used to show a record. You can change it if the default one corresponds to a possible id in your dao.

  • access: protected
string $templateAssign = 'MAIN' (line 83)

the template variable name to display a CRUD content in the main template

of the html response

  • access: protected
mixed $uploadsDirectory = '' (line 99)
  • access: protected
string $viewTemplate = 'jelix~crud_view' (line 70)

template to display a record

  • access: protected

Inherited Variables

Inherited from jController

jController::$pluginParams
jController::$request
Methods
create (line 221)

display a form to create a record

void create ()
delete (line 428)

delete a record

void delete ()
editupdate (line 317)

displays a forms to edit an existing record. The form should be

prepared with the preupdate before, so a refresh of the page won't cause a reset of the form

void editupdate ()
index (line 140)

list all records

void index ()
precreate (line 208)

prepare a form to create a record.

void precreate ()
preupdate (line 289)

prepare a form in order to edit an existing record, and redirect to the editupdate action

void preupdate ()
savecreate (line 252)

save data of a form in a new record

void savecreate ()
saveupdate (line 352)

save data of a form in a new record

void saveupdate ()
view (line 388)

displays a record

void view ()
_afterCreate (line 281)

overload this method if you wan to do additionnal things after the creation of

a record

  • access: protected
void _afterCreate (jFormsBase $form, mixed $id, jResponseHtml $resp)
_afterUpdate (line 381)

overload this method if you wan to do additionnal things after the update of

a record

  • access: protected
void _afterUpdate (jFormsBase $form, mixed $id, jResponseHtml $resp)
_checkDatas (line 133)

you can do your own data check of a form by overloading this method.

You can also do some other things. It is called only if the $form->check() is ok. and before the save of the data.

  • return: true if it is ok.
  • access: protected
boolean _checkDatas (jFormsBase $form, boolean $calltype)
  • jFormsBase $form: the current form
  • boolean $calltype: true for an update, false for a create
_create (line 245)

overload this method if you wan to do additionnal things on the response and on the edit template during the create action.

  • access: protected
void _create (jFormsBase $form, jResponseHtml $resp, jtpl $tpl)
_delete (line 445)

overload this method if you want to do additionnal things before the deletion of a record

  • return: true if the record can be deleted
  • access: protected
boolean _delete (mixed $id, jResponseHtml $resp)
  • mixed $id: the new id of the record
  • jResponseHtml $resp: the response
_editUpdate (line 345)

overload this method if you wan to do additionnal things on the response and on the edit template during the editupdate action.

  • access: protected
void _editUpdate (jFormsBase $form, jResponseHtml $resp, jtpl $tpl)
_getAction (line 120)

returned the selector of the action corresponding of the given method of the current controller.

  • return: an action selector
  • access: protected
string _getAction (string $method)
  • string $method: name of one of method of this controller
_getResponse (line 111)

Returned a simple html response to display CRUD contents. You can override this

method to return a personnalized response

  • return: the response
  • access: protected
jResponseHtml _getResponse ()
_index (line 190)

overload this method if you wan to do additionnal things on the response and on the list template during the index action.

  • access: protected
void _index (jResponseHtml $resp, jtpl $tpl)
  • jResponseHtml $resp: the response
  • jtpl $tpl: the template to display the record list
_indexSetConditions (line 199)

overload this method if you wan to do additionnal conditions to the index's select during the index action.

  • access: protected
void _indexSetConditions (jDaoConditions $cond)
_view (line 421)

overload this method if you want to do additionnal things on the response and on the view template during the view action.

  • access: protected
void _view (jFormsBase $form, jResponseHtml $resp, jtpl $tpl)

Inherited Methods

Inherited From jController

jController::__construct()
jController::boolParam()
jController::floatParam()
jController::getResponse()
jController::intParam()
jController::param()
jController::params()
jController::processZone()

Documentation generated on Wed, 07 Sep 2011 13:46:48 +0200 by phpDocumentor 1.4.3