/** * @test */ public function shouldExtractId() { //given $product = new Product(array('id' => 1)); //when $id = Functions::call(Functions::extractId(), $product); //then $this->assertEquals(1, $id); }
/** * @param Game $game * @return Hit[] */ public static function findForGame(Game $game) { $gameUserIds = Arrays::map($game->game_users, Functions::extractId()); return Hit::where(['game_user_id' => $gameUserIds])->with('game_user->user')->order('id desc')->limit(9)->fetchAll(); }