Last active
March 2, 2016 16:11
-
-
Save mlauren/193ad61243917a8c91b8 to your computer and use it in GitHub Desktop.
replace typeFeaturedHomepage method for Class VoShortCodes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class VoShortCodes { | |
public static function typeFeaturedHomepage() { | |
$cache = new Cache(); | |
$listings = []; | |
$searchMult = new VoSearchMult; | |
$types = ['RE','LA']; | |
foreach ( $types as $type ) { | |
$la_query_vars = [ | |
'type' => $type, | |
'advanced_search' => '', | |
'limit' => '100', | |
'query_vars' => [ | |
'L_ListOffice1' => 'VINA00', | |
'L_State' => 'TX', | |
] | |
]; | |
$file = "home_".$type."_100_search.json"; | |
if(!json_decode($cache->get($file), true)) { | |
$searchListings = $searchMult->do_search_return_listings($la_query_vars); | |
$cache->add($file, json_encode($searchListings)); | |
} else { | |
$searchListings = json_decode($cache->get($file), true); | |
} | |
$listings = array_merge($listings, $searchListings); | |
} | |
return $listings; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment