src/Phlexible/Bundle/GuiBundle/Response/ResultResponse.php
public function setResult($result = self::RESULT_SUCCESS,
                              $message = null,
                              array $data = [],
                              array $additional = [])
    {
        $this->headers->set('X-Phlexible-Response', 'result');

        $values = [
            'success' => $result,
            'msg' => $message,
            'data' => $data,
        ];

        if (is_array($additional) && count($additional)) {
            foreach ($additional as $key => $value) {
                $values += $additional;
            }
        }

        $this->setData($values);
    }
public function setResult($result = self::RESULT_SUCCESS,
                              $message = null,
                              array $data = [],
                              array $additional = [])
    {
        $this->headers->set('X-Phlexible-Response', 'result');

        $values = [
            'success' => $result,
            'msg' => $message,
            'data' => $data,
        ];

        if (is_array($additional) && count($additional)) {
            foreach ($additional as $key => $value) {
                $values += $additional;
            }
        }

        $this->setData($values);
    }
public function setResult ( $ result = self :: RESULT_SUCCESS , $ message = null , array $ data = [ ] , array $ additional = [ ] ) { $ this -> headers -> set ( 'X-Phlexible-Response' , 'result' ) ; $ values = [ 'success' => $ result , 'msg' => $ message , 'data' => $ data , ] ; if ( is_array ( $ additional ) && count ( $ additional ) ) { foreach ( $ additional as $ key => $ value ) { $ values += $ additional ; } } $ this -> setData ( $ values ) ; }
Generate a standard result.

@param bool  $result     True for success, false for failure
@param array $message    (Optional) Message
@param array $data       (Optional) Data
@param array $additional (Optional) Additional values
Generate a standard result .