SearchSub respects empty set from memcache.
This commit is contained in:
parent
d4b7f5d8ac
commit
6ff3149082
@ -147,18 +147,18 @@ class SearchSub extends Managed_DataObject
|
|||||||
$keypart = sprintf('searchsub:by_profile:%d', $profile->id);
|
$keypart = sprintf('searchsub:by_profile:%d', $profile->id);
|
||||||
$searchstring = self::cacheGet($keypart);
|
$searchstring = self::cacheGet($keypart);
|
||||||
|
|
||||||
if ($searchstring !== false && !empty($searchstring)) {
|
if ($searchstring !== false) {
|
||||||
|
if (!empty($searchstring)) {
|
||||||
$searches = explode(',', $searchstring);
|
$searches = explode(',', $searchstring);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$searchsub = new SearchSub();
|
$searchsub = new SearchSub();
|
||||||
$searchsub->profile_id = $profile->id;
|
$searchsub->profile_id = $profile->id;
|
||||||
|
$searchsub->selectAdd();
|
||||||
|
$searchsub->selectAdd('search');
|
||||||
|
|
||||||
if ($searchsub->find()) {
|
if ($searchsub->find()) {
|
||||||
while ($searchsub->fetch()) {
|
$searches = $searchsub->fetchAll('search');
|
||||||
if (!empty($searchsub->search)) {
|
|
||||||
$searches[] = $searchsub->search;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
self::cacheSet($keypart, implode(',', $searches));
|
self::cacheSet($keypart, implode(',', $searches));
|
||||||
|
Loading…
Reference in New Issue
Block a user