public static function isLikedBy($storyId, $userId) { $subscribers = isset(self::$storyLikes[$storyId]) ? self::$storyLikes[$storyId] : []; return in_array($userId, $subscribers); }
public function hasViewerLiked(Story $story, $args, AppContext $context) { return DataSource::isLikedBy($story->id, $context->viewer->id); }