src/Cocorico/CoreBundle/Form/Handler/Frontend/ListingFormHandler.php
/**
     * Add selected categories and corresponding fields values from post parameters while listing deposit
     *
     * @param  Listing $listing
     * @return Listing
     */
Add selected categories and corresponding fields values from post parameters while listing deposit
@param  Listing $listing
@return Listing
Add selected categories and corresponding fields values from post parameters while listing deposit @param Listing $listing @return Listing
public function addCategories(Listing $listing)
    {
        $categories = $this->request->request->get("listing_categories");
        $listingCategories = isset($categories["listingListingCategories"]) ? $categories["listingListingCategories"] : array();
        $listingCategoriesValues = isset($categories["categoriesFieldsSearchableValuesOrderedByGroup"]) ? $categories["categoriesFieldsSearchableValuesOrderedByGroup"] : array();
        if ($categories) {
            $listing = $this->listingManager->addCategories(
                $listing,
                $listingCategories,
                $listingCategoriesValues
            );
        }
        return $listing;
    }
public function addCategories ( Listing $ listing ) { $ categories = $ this -> request -> request -> get ( " listing_categories " ) ; $ listingCategories = isset ( $ categories [ " listingListingCategories " ] ) ? $ categories [ " listingListingCategories " ] : array ( ) ; $ listingCategoriesValues = isset ( $ categories [ " categoriesFieldsSearchableValuesOrderedByGroup " ] ) ? $ categories [ " categoriesFieldsSearchableValuesOrderedByGroup " ] : array ( ) ; if ( $ categories ) { $ listing = $ this -> listingManager -> addCategories ( $ listing , $ listingCategories , $ listingCategoriesValues ) ; } return $ listing ; }
Add selected categories and corresponding fields values from post parameters while listing deposit
 @param  Listing $listing
 @return Listing
Add selected categories and corresponding fields values from post parameters while listing deposit @param Listing $listing @return Listing