Ubiquity 2.5.2
php rapid development framework
|
Associated with a CRUDController class Responsible of the display. More...
Public Member Functions | |
__construct (HasModelViewerInterface $controller, $style=null) | |
setStyle ($elm) | |
getModelDataElement ($instance, $model, $modal) | |
Returns a DataElement object for displaying the instance Used in the display method of the CrudController in display route. | |
getElementCaptions ($captions, $className, $instance) | |
Returns the captions for DataElement fields in display route. | |
getModelDataTable ($instances, $model, $totalCount, $page=1) | |
Returns the dataTable responsible for displaying instances of the model. | |
setDataTableAttributes (DataTable $dataTable, $attributes, $model, $instances, $selector=null) | |
addEditMemberFonctionality ($part) | |
recordsPerPage ($model, $totalCount=0) | |
getGroupByFields () | |
Returns the fields on which a grouping is performed. | |
addAllButtons (DataTable $dataTable, $attributes) | |
getTransition () | |
The default transition for display, edit and delete behaviors. | |
getDataTableId () | |
onDataTableRowButton (HtmlButton $bt,?string $name=null) | |
To override for modifying the dataTable row buttons. | |
onConfirmButtons (HtmlButton $confirmBtn, HtmlButton $cancelBtn) | |
To override for modifying the showConfMessage dialog buttons. | |
getCaptions ($captions, $className) | |
Returns the captions for list fields in showTable action. | |
getFkHeaderElementDetails ($member, $className, $object) | |
Returns the header for a single foreign object (element is an instance, issue from ManyToOne), (from DataTable) | |
getFkHeaderListDetails ($member, $className, $list) | |
Returns the header for a list of foreign objects (issue from oneToMany or ManyToMany), (from DataTable) | |
getFkElementDetails ($member, $className, $object) | |
Returns a component for displaying a single foreign object (manyToOne relation), (from DataTable) | |
getFkListDetails ($member, $className, $list) | |
Returns a list component for displaying a collection of foreign objects (*ToMany relations), (from DataTable) | |
getFkMemberElementDetails ($memberFK, $objectFK, $fkClass, $fkTable) | |
Returns a component for displaying a foreign object (from DataTable) | |
onDisplayFkElementListDetails ($element, $member, $className, $object) | |
To modify for displaying an element in a list component of foreign objects (from DataTable) | |
getFkMemberElement ($memberFK, $objectFK, $fkClass, $fkTable) | |
Returns a component for displaying a foreign object (from DataElement) | |
getFkList ($member, $list) | |
Returns a list component for displaying a collection of foreign objects (*ToMany relations), (from DataElement) | |
displayFkElementList ($element, $member, $className, $object) | |
To modify for displaying an element in a list component of foreign objects, (from DataElement) | |
getFkElement ($member, $className, $object) | |
Returns a component for displaying a single foreign object (manyToOne relation), (from DataElement) | |
showDetailsOnDataTableClick () | |
To override to make sure that the detail of a clicked object is displayed or not. | |
Public Member Functions inherited from FormModelViewerTrait | |
getEditMemberParams () | |
getForm ($identifier, $instance, $updateUrl='updateModel') | |
Returns the form for adding or modifying an object. | |
getMemberForm ($identifier, $instance, $member, $td, $part, $updateUrl='_updateMember') | |
Returns a form for member editing. | |
setFormFieldsComponent (DataForm $form, $fieldTypes, $attributes=[]) | |
Sets the components for each field. | |
setMemberFormFieldsComponent (DataForm $form, $fieldTypes, $attributes=[]) | |
Sets the components for each field. | |
onGenerateFormField ($field, $nb, $name) | |
For doing something when $field is generated in form. | |
isModal ($objects, $model) | |
Condition to determine if the edit or add form is modal for $model objects. | |
getFormCaptions ($captions, $className, $instance) | |
Returns the captions for form fields. | |
getFormModalTitle (object $instance) | |
Returns the modal Title. | |
formHasMessage () | |
If true, display a message for editing or updating (default true). | |
onFormModalButtons (HtmlButton $btOkay, HtmlButton $btCancel) | |
Hook for changing the edit/new modal buttons. | |
Protected Member Functions | |
getDataTableInstance ($instances, $model, $totalCount, $page=1) | |
Returns the dataTable instance for dispaying a list of object. | |
getDataTableRowButtons () | |
Returns an array of buttons ["display","edit","delete"] to display for each row in dataTable. | |
Protected Member Functions inherited from FormModelViewerTrait | |
relationMembersInForm ($form, $instance, $className, $fields, $relations, &$fieldTypes) | |
manyToOneFormField ($form, $member, $className, $instance) | |
oneToManyFormField (DataForm $form, $member, $instance, $annot) | |
oneToManyFormFieldDt (DataForm $form, $member, $instance, $annot) | |
dtManyField (DataTable $dt, $className, array $relations, array $fields) | |
dtManyFieldCmb ($dt, $member, $className) | |
manyToManyFormField (DataForm $form, $member, $instance, $annot) | |
getEditMemberParams_ ($part) | |
defaultEditMemberParams () | |
getFormTitle ($form, $instance) | |
Returns an associative array defining form message title with keys "icon","message","subMessage". | |
Protected Attributes | |
$controller | |
Private Attributes | |
$jquery | |
$style | |
Associated with a CRUDController class Responsible of the display.
Definition at line 25 of file ModelViewer.php.
__construct | ( | HasModelViewerInterface | $controller, |
$style = null |
|||
) |
Definition at line 39 of file ModelViewer.php.
addAllButtons | ( | DataTable | $dataTable, |
$attributes | |||
) |
Definition at line 224 of file ModelViewer.php.
addEditMemberFonctionality | ( | $part | ) |
Definition at line 156 of file ModelViewer.php.
displayFkElementList | ( | $element, | |
$member, | |||
$className, | |||
$object | |||
) |
To modify for displaying an element in a list component of foreign objects, (from DataElement)
\Ajax\common\html\HtmlDoubleElement | $element | |
string | $member | |
string | $className | |
object | $object |
Definition at line 453 of file ModelViewer.php.
getCaptions | ( | $captions, | |
$className | |||
) |
Returns the captions for list fields in showTable action.
array | $captions | |
string | $className |
Definition at line 291 of file ModelViewer.php.
getDataTableId | ( | ) |
Reimplemented from FormModelViewerTrait.
Definition at line 263 of file ModelViewer.php.
|
protected |
Returns the dataTable instance for dispaying a list of object.
array | $instances | |
string | $model | |
number | $totalCount | |
number | $page |
Definition at line 194 of file ModelViewer.php.
|
protected |
Returns an array of buttons ["display","edit","delete"] to display for each row in dataTable.
Definition at line 220 of file ModelViewer.php.
getElementCaptions | ( | $captions, | |
$className, | |||
$instance | |||
) |
Returns the captions for DataElement fields in display route.
array | $captions | |
string | $className |
Definition at line 95 of file ModelViewer.php.
getFkElement | ( | $member, | |
$className, | |||
$object | |||
) |
Returns a component for displaying a single foreign object (manyToOne relation), (from DataElement)
string | $member | |
string | $className | |
object | $object |
Definition at line 464 of file ModelViewer.php.
getFkElementDetails | ( | $member, | |
$className, | |||
$object | |||
) |
Returns a component for displaying a single foreign object (manyToOne relation), (from DataTable)
string | $member | |
string | $className | |
object | $object |
Definition at line 329 of file ModelViewer.php.
getFkHeaderElementDetails | ( | $member, | |
$className, | |||
$object | |||
) |
Returns the header for a single foreign object (element is an instance, issue from ManyToOne), (from DataTable)
string | $member | |
string | $className | |
object | $object |
Definition at line 303 of file ModelViewer.php.
getFkHeaderListDetails | ( | $member, | |
$className, | |||
$list | |||
) |
Returns the header for a list of foreign objects (issue from oneToMany or ManyToMany), (from DataTable)
string | $member | |
string | $className | |
array | $list |
Definition at line 316 of file ModelViewer.php.
getFkList | ( | $member, | |
$list | |||
) |
Returns a list component for displaying a collection of foreign objects (*ToMany relations), (from DataElement)
string | $member | |
string | $className | |
array | \Traversable | $list |
Definition at line 439 of file ModelViewer.php.
getFkListDetails | ( | $member, | |
$className, | |||
$list | |||
) |
Returns a list component for displaying a collection of foreign objects (*ToMany relations), (from DataTable)
string | $member | |
string | $className | |
array | \Traversable | $list |
Definition at line 342 of file ModelViewer.php.
getFkMemberElement | ( | $memberFK, | |
$objectFK, | |||
$fkClass, | |||
$fkTable | |||
) |
Returns a component for displaying a foreign object (from DataElement)
string | $memberFK | |
mixed | $objectFK | |
string | $fkClass | |
string | $fkTable |
Definition at line 407 of file ModelViewer.php.
getFkMemberElementDetails | ( | $memberFK, | |
$objectFK, | |||
$fkClass, | |||
$fkTable | |||
) |
Returns a component for displaying a foreign object (from DataTable)
string | $memberFK | |
mixed | $objectFK | |
string | $fkClass | |
string | $fkTable |
Definition at line 358 of file ModelViewer.php.
getGroupByFields | ( | ) |
Returns the fields on which a grouping is performed.
Definition at line 181 of file ModelViewer.php.
getModelDataElement | ( | $instance, | |
$model, | |||
$modal | |||
) |
Returns a DataElement object for displaying the instance Used in the display method of the CrudController in display route.
object | $instance | |
string | $model | The model class name (long name) |
boolean | $modal |
Definition at line 64 of file ModelViewer.php.
getModelDataTable | ( | $instances, | |
$model, | |||
$totalCount, | |||
$page = 1 |
|||
) |
Returns the dataTable responsible for displaying instances of the model.
array | $instances | objects to display |
string | $model | model class name (long name) |
Definition at line 106 of file ModelViewer.php.
getTransition | ( | ) |
The default transition for display, edit and delete behaviors.
Definition at line 259 of file ModelViewer.php.
onConfirmButtons | ( | HtmlButton | $confirmBtn, |
HtmlButton | $cancelBtn | ||
) |
To override for modifying the showConfMessage dialog buttons.
HtmlButton | $confirmBtn | The confirmation button |
HtmlButton | $cancelBtn | The cancellation button |
Definition at line 282 of file ModelViewer.php.
onDataTableRowButton | ( | HtmlButton | $bt, |
?string | $name = null |
||
) |
To override for modifying the dataTable row buttons.
HtmlButton | $bt | |
?string | $name |
Definition at line 273 of file ModelViewer.php.
onDisplayFkElementListDetails | ( | $element, | |
$member, | |||
$className, | |||
$object | |||
) |
To modify for displaying an element in a list component of foreign objects (from DataTable)
\Ajax\common\html\HtmlDoubleElement | $element | |
string | $member | |
string | $className | |
object | $object |
Definition at line 395 of file ModelViewer.php.
recordsPerPage | ( | $model, | |
$totalCount = 0 |
|||
) |
string | $model | The model class name (long name) |
number | $totalCount | The total count of objects |
Definition at line 171 of file ModelViewer.php.
setDataTableAttributes | ( | DataTable | $dataTable, |
$attributes, | |||
$model, | |||
$instances, | |||
$selector = null |
|||
) |
Definition at line 129 of file ModelViewer.php.
setStyle | ( | $elm | ) |
Definition at line 45 of file ModelViewer.php.
showDetailsOnDataTableClick | ( | ) |
To override to make sure that the detail of a clicked object is displayed or not.
Definition at line 474 of file ModelViewer.php.
|
protected |
Definition at line 37 of file ModelViewer.php.
|
private |
Definition at line 30 of file ModelViewer.php.
|
private |
Definition at line 31 of file ModelViewer.php.