$reply->profile_id = $user->id;
$id = $reply->insert();
-
- self::blow('reply:stream:%d', $user->id);
}
}
throw new ServerException("Couldn't save reply for {$this->id}, {$mentioned->id}");
} else {
$replied[$mentioned->id] = 1;
+ self::blow('reply:stream:%d', $mentioned->id);
}
}
}
foreach ($recipientIds as $recipientId) {
$user = User::staticGet('id', $recipientId);
if (!empty($user)) {
- self::blow('reply:stream:%d', $recipientId);
mail_notify_attn($user, $this);
}
}
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
+ /**
+ * Wrapper for record insertion to update related caches
+ */
+ function insert()
+ {
+ $result = parent::insert();
+
+ if ($result) {
+ self::blow('reply:stream:%d', $this->profile_id);
+ }
+
+ return $result;
+ }
+
function stream($user_id, $offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $max_id=0)
{
$ids = Notice::stream(array('Reply', '_streamDirect'),