GraphQL\Examples\Blog\Data\DataSource::isLikedBy PHP Метод

isLikedBy() публичный статический Метод

public static isLikedBy ( $storyId, $userId )
    public static function isLikedBy($storyId, $userId)
    {
        $subscribers = isset(self::$storyLikes[$storyId]) ? self::$storyLikes[$storyId] : [];
        return in_array($userId, $subscribers);
    }

Usage Example

Пример #1
0
 public function hasViewerLiked(Story $story, $args, AppContext $context)
 {
     return DataSource::isLikedBy($story->id, $context->viewer->id);
 }