Zepi/Web/UserInterface/src/Form/Field/ExtendedEntitySelect.php
public function executeFormUpdateRequest(WebRequest $request, Response $response, Form $form)
    {
        $responseData = array('csrf' => $form->generateCsrfToken($request));
        
        // If the search param not set return with an empty response
        if (!$request->hasParam('form-extended-entity-select-query')) {
            $responseData['data'] = array();
            $response->setOutput(json_encode($responseData), true);
            return;
        }
        
        $query = $request->getParam('form-extended-entity-select-query');
        $entities = $this->getAvailableValues($query);
        
        if ($entities === false) {
            $response->setOutput(json_encode(array('error' => true)), true);
            return;
        }
        
        $data = array();
        foreach ($entities as $entity) {
            $data[] = array('id' => $entity->getId(), 'name' => (string) $entity);
        }
        
        $responseData['data'] = $data;
        
        $response->setOutput(json_encode($responseData), true);
    }
public function executeFormUpdateRequest(WebRequest $request, Response $response, Form $form)
    {
        $responseData = array('csrf' => $form->generateCsrfToken($request));
        
        // If the search param not set return with an empty response
        if (!$request->hasParam('form-extended-entity-select-query')) {
            $responseData['data'] = array();
            $response->setOutput(json_encode($responseData), true);
            return;
        }
        
        $query = $request->getParam('form-extended-entity-select-query');
        $entities = $this->getAvailableValues($query);
        
        if ($entities === false) {
            $response->setOutput(json_encode(array('error' => true)), true);
            return;
        }
        
        $data = array();
        foreach ($entities as $entity) {
            $data[] = array('id' => $entity->getId(), 'name' => (string) $entity);
        }
        
        $responseData['data'] = $data;
        
        $response->setOutput(json_encode($responseData), true);
    }
public function executeFormUpdateRequest ( WebRequest $ request , Response $ response , Form $ form ) { $ responseData = array ( 'csrf' => $ form -> generateCsrfToken ( $ request ) ) ; // If the search param not set return with an empty response if ( ! $ request -> hasParam ( 'form-extended-entity-select-query' ) ) { $ responseData [ 'data' ] = array ( ) ; $ response -> setOutput ( json_encode ( $ responseData ) , true ) ; return ; } $ query = $ request -> getParam ( 'form-extended-entity-select-query' ) ; $ entities = $ this -> getAvailableValues ( $ query ) ; if ( $ entities === false ) { $ response -> setOutput ( json_encode ( array ( 'error' => true ) ) , true ) ; return ; } $ data = array ( ) ; foreach ( $ entities as $ entity ) { $ data [ ] = array ( 'id' => $ entity -> getId ( ) , 'name' => ( string ) $ entity ) ; } $ responseData [ 'data' ] = $ data ; $ response -> setOutput ( json_encode ( $ responseData ) , true ) ; }
Executes the form update request

@param \Zepi\Turbo\Request\WebRequest $request
@param \Zepi\Turbo\Response\Response $response
@param \Zepi\Web\UserInterface\Form\Form $form
Executes the form update request