- function getLists($showPrivate)
- {
- $ids = array();
-
- $keypart = sprintf('profile:lists:%d', $this->id);
-
- $idstr = self::cacheGet($keypart);
-
- if ($idstr !== false) {
- $ids = explode(',', $idstr);
- } else {
- $list = new Profile_list();
- $list->selectAdd();
- $list->selectAdd('id');
- $list->tagger = $this->id;
-
- if ($list->find()) {
- while ($list->fetch()) {
- $ids[] = $list->id;
- }
- }
-
- self::cacheSet($keypart, implode(',', $ids));
- }
-
- $lists = array();
-
- foreach ($ids as $id) {
- $list = Profile_list::staticGet('id', $id);
- if (!empty($list) &&
- ($showPrivate || !$list->private)) {
- $lists[] = $list;
- }
- }
+ /**
+ * Magic function called at serialize() time.
+ *
+ * We use this to drop a couple process-specific references
+ * from DB_DataObject which can cause trouble in future
+ * processes.
+ *
+ * @return array of variable names to include in serialization.
+ */