3 * Copyright (c) 2014, Facebook, Inc.
6 * This source code is licensed under the BSD-style license found in the
7 * LICENSE file in the "hack" directory of this source tree. An additional grant
8 * of patent rights can be found in the PATENTS file in the same directory.
12 class BirthdayStoryPreparable
extends Preparable
{
13 private $userIDs, $viewerContext, $users = MUST_PREPARE
;
15 public function __construct(ViewerContext
$vc, $user_ids) {
16 $this->viewerContext
= $vc;
17 $this->userIDs
= IDAssert
::allUid($user_ids);
20 public function getUsers() {
21 return must_prepare($this->users
);
24 public function getCurrentPosts() {
25 $from = $this->viewerContext
->getUserID();
26 $to_users = array_keys($this->users
);
27 return DT('TickerBirthdayPost', $from)->getAll($to_users);
30 public function prepare($pass) {
34 Ent
::createEnforcingLoaderDynamic(
40 Ent
::load('BasicInfo'),
41 Ent
::load('Birthday'),
42 Ent
::load('ProfilePic', PicSizeConst
::SQUARE
),
49 $from = $this->viewerContext
->getUserID();
50 $to_users = array_keys($this->users
);
51 DT('TickerBirthdayPost', $from)->addAll($to_users);