Skip to content

Instantly share code, notes, and snippets.

@mlauren
Last active March 2, 2016 16:11
Show Gist options
  • Save mlauren/193ad61243917a8c91b8 to your computer and use it in GitHub Desktop.
Save mlauren/193ad61243917a8c91b8 to your computer and use it in GitHub Desktop.
replace typeFeaturedHomepage method for Class VoShortCodes
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