Overview

Namespaces

  • DcGeneral
    • Clipboard
    • Contao
      • Callback
      • Compatibility
      • DataDefinition
        • Definition
      • Dca
        • Builder
          • Legacy
        • Definition
        • Palette
        • Populator
      • Event
      • View
        • Contao2BackendView
          • Event
    • Controller
    • Data
    • DataDefinition
      • Builder
      • Definition
        • Properties
        • View
          • Panel
      • ModelRelationship
      • Palette
        • Builder
          • Event
        • Condition
          • Palette
          • Property
    • EnvironmentPopulator
    • Event
    • Exception
    • Factory
      • Event
    • Panel
    • View
      • Event

Classes

  • AbstractCallbackListener
  • AbstractReturningCallbackListener
  • AbstractStaticCallbackListener
  • Callbacks
  • ContainerGetBreadcrumbCallbackListener
  • ContainerGlobalButtonCallbackListener
  • ContainerHeaderCallbackListener
  • ContainerOnCopyCallbackListener
  • ContainerOnCutCallbackListener
  • ContainerOnDeleteCallbackListener
  • ContainerOnLoadCallbackListener
  • ContainerOnSubmitCallbackListener
  • ContainerPasteButtonCallbackListener
  • ContainerPasteRootButtonCallbackListener
  • ModelChildRecordCallbackListener
  • ModelGroupCallbackListener
  • ModelLabelCallbackListener
  • ModelOperationButtonCallbackListener
  • ModelOptionsCallbackListener
  • PropertyInputFieldCallbackListener
  • PropertyInputFieldGetWizardCallbackListener
  • PropertyOnLoadCallbackListener
  • PropertyOnSaveCallbackListener
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo
 1: <?php
 2: /**
 3:  * PHP version 5
 4:  * @package    generalDriver
 5:  * @author     Christian Schiffler <c.schiffler@cyberspectrum.de>
 6:  * @author     Stefan Heimes <stefan_heimes@hotmail.com>
 7:  * @author     Tristan Lins <tristan.lins@bit3.de>
 8:  * @copyright  The MetaModels team.
 9:  * @license    LGPL.
10:  * @filesource
11:  */
12: 
13: namespace DcGeneral\Contao\Callback;
14: 
15: use DcGeneral\Contao\View\Contao2BackendView\Event\ParentViewChildRecordEvent;
16: 
17: /**
18:  * Class ModelChildRecordCallbackListener.
19:  *
20:  * Handler for the child record callbacks.
21:  *
22:  * @package DcGeneral\Contao\Callback
23:  */
24: class ModelChildRecordCallbackListener extends AbstractReturningCallbackListener
25: {
26:     /**
27:      * Retrieve the arguments for the callback.
28:      *
29:      * @param ParentViewChildRecordEvent $event The event being emitted.
30:      *
31:      * @return array
32:      */
33:     public function getArgs($event)
34:     {
35:         return array(
36:             $event->getModel()->getPropertiesAsArray()
37:         );
38:     }
39: 
40:     /**
41:      * Set the HTML code for the button.
42:      *
43:      * @param ParentViewChildRecordEvent $event The event being emitted.
44:      *
45:      * @param string                     $value The value returned by the callback.
46:      *
47:      * @return void
48:      */
49:     public function update($event, $value)
50:     {
51:         if (is_null($value))
52:         {
53:             return;
54:         }
55: 
56:         $event->setHtml($value);
57:         $event->stopPropagation();
58:     }
59: }
60: 
contao-community-alliance/dc-general API documentation generated by ApiGen 2.8.0