public function quarterback($createCommand) {

        // Convert the command bus object into an array
        $data = (array) $createCommand;


        // Sanitize
        $data = $this->sanitize($data, $this->type);


        // Validate
        if ($this->validate($data, $this->type) != "passed")
        {
            // Prepare the response array, and then return to the form with error messages
            return $this->prepareResponseArray('validation_failed', 500, $data, $this->validate($data, $this->type));
        }


        // Even though we already sanitized the data, we further "wash" the data
        $data = $this->wash($data);


        // INSERT record
        if (!$this->persist($data, $this->type))
        {
            // Prepare the response array, and then return to the form with error messages
            // Laravel's https://github.com/laravel/framework/blob/5.0/src/Illuminate/Database/Eloquent/Model.php
            //  does not prepare a MessageBag object, so we'll whip up an error message in the
            //  originating controller
            return $this->prepareResponseArray('persist_failed', 500, $data);
        }


        // SPECIAL FOR POST UPDATES: INDICATE IN THE POSTS TABLE THAT THERE IS AT LEAST ONE POST UPDATE FOR THAT POST
        $this->repository->postupdateExists($data['post_id']);


        // Prepare the response array, and then return to the controller
        return $this->prepareResponseArray('create_successful', 200, $data);


        ///////////////////////////////////////////////////////////////////
        ///     NO EVENTS ARE SPECIFIED IN THE BASE FORM PROCESSING     ///
        ///////////////////////////////////////////////////////////////////
    }
public function quarterback($createCommand) {

        // Convert the command bus object into an array
        $data = (array) $createCommand;


        // Sanitize
        $data = $this->sanitize($data, $this->type);


        // Validate
        if ($this->validate($data, $this->type) != "passed")
        {
            // Prepare the response array, and then return to the form with error messages
            return $this->prepareResponseArray('validation_failed', 500, $data, $this->validate($data, $this->type));
        }


        // Even though we already sanitized the data, we further "wash" the data
        $data = $this->wash($data);


        // INSERT record
        if (!$this->persist($data, $this->type))
        {
            // Prepare the response array, and then return to the form with error messages
            // Laravel's https://github.com/laravel/framework/blob/5.0/src/Illuminate/Database/Eloquent/Model.php
            //  does not prepare a MessageBag object, so we'll whip up an error message in the
            //  originating controller
            return $this->prepareResponseArray('persist_failed', 500, $data);
        }


        // SPECIAL FOR POST UPDATES: INDICATE IN THE POSTS TABLE THAT THERE IS AT LEAST ONE POST UPDATE FOR THAT POST
        $this->repository->postupdateExists($data['post_id']);


        // Prepare the response array, and then return to the controller
        return $this->prepareResponseArray('create_successful', 200, $data);


        ///////////////////////////////////////////////////////////////////
        ///     NO EVENTS ARE SPECIFIED IN THE BASE FORM PROCESSING     ///
        ///////////////////////////////////////////////////////////////////
    }
public function quarterback ( $ createCommand ) { // Convert the command bus object into an array $ data = ( array ) $ createCommand ; // Sanitize $ data = $ this -> sanitize ( $ data , $ this -> type ) ; // Validate if ( $ this -> validate ( $ data , $ this -> type ) != "passed" ) { // Prepare the response array, and then return to the form with error messages return $ this -> prepareResponseArray ( 'validation_failed' , 500 , $ data , $ this -> validate ( $ data , $ this -> type ) ) ; } // Even though we already sanitized the data, we further "wash" the data $ data = $ this -> wash ( $ data ) ; // INSERT record if ( ! $ this -> persist ( $ data , $ this -> type ) ) { // Prepare the response array, and then return to the form with error messages // Laravel's https://github.com/laravel/framework/blob/5.0/src/Illuminate/Database/Eloquent/Model.php //  does not prepare a MessageBag object, so we'll whip up an error message in the //  originating controller return $ this -> prepareResponseArray ( 'persist_failed' , 500 , $ data ) ; } // SPECIAL FOR POST UPDATES: INDICATE IN THE POSTS TABLE THAT THERE IS AT LEAST ONE POST UPDATE FOR THAT POST $ this -> repository -> postupdateExists ( $ data [ 'post_id' ] ) ; // Prepare the response array, and then return to the controller return $ this -> prepareResponseArray ( 'create_successful' , 200 , $ data ) ; /////////////////////////////////////////////////////////////////// ///     NO EVENTS ARE SPECIFIED IN THE BASE FORM PROCESSING     /// /////////////////////////////////////////////////////////////////// }
The form processing steps.

@param  object  $createCommand   The command bus object
@return array                    The custom response array
The form processing steps .