private function handleAction(Request $request, &$data) {
        // Keyword Search
        if ($this->isAction($request, "searchByKeyword")) {
            $preparedKeywords = htmlspecialchars($data["keywords"]);
            $data["listings"] = $this->listingController($data)
                    ->setSortBy($data["sortBy"])->setReverseSort($data["reverseSort"])
                    ->searchByKeyword($preparedKeywords);
        }
        // Advanced Search
        else if ($this->isAction($request, "search")) {
            $data["listings"] = $this->listingController($data)
                    ->setSortBy($data["sortBy"])->setReverseSort($data["reverseSort"])
                    ->search($data["keywords"], $data["extra"], $data["maxPrice"], $data["minPrice"], $data["beds"], $data["baths"], $data["includeResidential"], $data["includeLand"], $data["includeCommercial"]);
        }
        // Return Listings by DMQL
        else if ($this->isAction($request, "getListingsByDMQL")) {
            $results = GetRETS::getRETSListing()
                    ->setSortBy($data["sortBy"])->setReverseSort($data["reverseSort"])
                    ->getListingsByDMQL($data["dmql"], ExampleController::EXAMPLE_SOURCE, "Residential");
            if (!empty($results)) {
                if ($results->success && !empty($results->data)) {
                    $data["listings"] = $results->data;
                }
            }
        }
        // Return raw DMQL results
        else if ($this->isAction($request, "executeDMQL")) {
            $data["rawData"] = GetRETS::getRETSListing()->executeDMQL($data["dmql"], ExampleController::EXAMPLE_SOURCE, "Residential");
        }
    }
private function handleAction(Request $request, &$data) {
        // Keyword Search
        if ($this->isAction($request, "searchByKeyword")) {
            $preparedKeywords = htmlspecialchars($data["keywords"]);
            $data["listings"] = $this->listingController($data)
                    ->setSortBy($data["sortBy"])->setReverseSort($data["reverseSort"])
                    ->searchByKeyword($preparedKeywords);
        }
        // Advanced Search
        else if ($this->isAction($request, "search")) {
            $data["listings"] = $this->listingController($data)
                    ->setSortBy($data["sortBy"])->setReverseSort($data["reverseSort"])
                    ->search($data["keywords"], $data["extra"], $data["maxPrice"], $data["minPrice"], $data["beds"], $data["baths"], $data["includeResidential"], $data["includeLand"], $data["includeCommercial"]);
        }
        // Return Listings by DMQL
        else if ($this->isAction($request, "getListingsByDMQL")) {
            $results = GetRETS::getRETSListing()
                    ->setSortBy($data["sortBy"])->setReverseSort($data["reverseSort"])
                    ->getListingsByDMQL($data["dmql"], ExampleController::EXAMPLE_SOURCE, "Residential");
            if (!empty($results)) {
                if ($results->success && !empty($results->data)) {
                    $data["listings"] = $results->data;
                }
            }
        }
        // Return raw DMQL results
        else if ($this->isAction($request, "executeDMQL")) {
            $data["rawData"] = GetRETS::getRETSListing()->executeDMQL($data["dmql"], ExampleController::EXAMPLE_SOURCE, "Residential");
        }
    }
private function handleAction ( Request $ request , & $ data ) { // Keyword Search if ( $ this -> isAction ( $ request , "searchByKeyword" ) ) { $ preparedKeywords = htmlspecialchars ( $ data [ "keywords" ] ) ; $ data [ "listings" ] = $ this -> listingController ( $ data ) -> setSortBy ( $ data [ "sortBy" ] ) -> setReverseSort ( $ data [ "reverseSort" ] ) -> searchByKeyword ( $ preparedKeywords ) ; } // Advanced Search else if ( $ this -> isAction ( $ request , "search" ) ) { $ data [ "listings" ] = $ this -> listingController ( $ data ) -> setSortBy ( $ data [ "sortBy" ] ) -> setReverseSort ( $ data [ "reverseSort" ] ) -> search ( $ data [ "keywords" ] , $ data [ "extra" ] , $ data [ "maxPrice" ] , $ data [ "minPrice" ] , $ data [ "beds" ] , $ data [ "baths" ] , $ data [ "includeResidential" ] , $ data [ "includeLand" ] , $ data [ "includeCommercial" ] ) ; } // Return Listings by DMQL else if ( $ this -> isAction ( $ request , "getListingsByDMQL" ) ) { $ results = GetRETS :: getRETSListing ( ) -> setSortBy ( $ data [ "sortBy" ] ) -> setReverseSort ( $ data [ "reverseSort" ] ) -> getListingsByDMQL ( $ data [ "dmql" ] , ExampleController :: EXAMPLE_SOURCE , "Residential" ) ; if ( ! empty ( $ results ) ) { if ( $ results -> success && ! empty ( $ results -> data ) ) { $ data [ "listings" ] = $ results -> data ; } } } // Return raw DMQL results else if ( $ this -> isAction ( $ request , "executeDMQL" ) ) { $ data [ "rawData" ] = GetRETS :: getRETSListing ( ) -> executeDMQL ( $ data [ "dmql" ] , ExampleController :: EXAMPLE_SOURCE , "Residential" ) ; } }
Handles requested action from a form post

@param Request $request
@param type $data
Handles requested action from a form post