extractId() public static method

public static extractId ( )
Ejemplo n.º 1
0
 /**
  * @test
  */
 public function shouldExtractId()
 {
     //given
     $product = new Product(array('id' => 1));
     //when
     $id = Functions::call(Functions::extractId(), $product);
     //then
     $this->assertEquals(1, $id);
 }
Ejemplo n.º 2
0
 /**
  * @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();
 }