PETDeckHydrator

class SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator
Hydrator class responsible for transforming data returned by the DB into actual objects, either Age cards, or tokens
Serves as middleware between the deck component and the objects defined in this project that rely on the component.
All undocumented methods are wrappers for the deck component whose documentation can be found on the BGA Studio
Source

modules/php/Middleware/PETDeckHydrator.php#33

Summary

Methods

Properties

private static property SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::$cardTypes
Card Types array used by the deck component
Source

modules/php/Middleware/PETDeckHydrator.php#40

Type

array

private static property SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::$tokenTypes
Token types array used by the component
Source

modules/php/Middleware/PETDeckHydrator.php#47

Type

array

private static property SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::$deckModule
Deck component from the BGA framework
Source

modules/php/Middleware/PETDeckHydrator.php#54

Type

\Deck

Methods

private SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::hydrateCard($cardArray)
Returns the PETAgeCard or PETToken object associated to the card from the Deck component. If none is found, then
null is returned
Source

modules/php/Middleware/PETDeckHydrator.php#64

Parameters
  • $cardArray (array | null)

Returns

\SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Object\PETAgeCard | \SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Object\PETToken | null

public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::setCardTypes($cardTypes)
Source

modules/php/Middleware/PETDeckHydrator.php#111

Parameters
  • $cardTypes (array)

Returns

$this

public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::setTokenTypes($tokenTypes)
Source

modules/php/Middleware/PETDeckHydrator.php#122

Parameters
  • $tokenTypes (array)

Returns

$this

public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::init($deckModule, $cardTable)
Wrapper fot Deck::init function
Source

modules/php/Middleware/PETDeckHydrator.php#136

Parameters
  • $deckModule (Deck)

  • $cardTable (string)

Returns

void

public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::createCards($PETDeckCardsArray, $location=\'deck\', $locationArg=null, $playerCount=1)
Source

modules/php/Middleware/PETDeckHydrator.php#150

Parameters
Returns

void

public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::pickCard($location, $playerId)
Source

modules/php/Middleware/PETDeckHydrator.php#166

Parameters
  • $location (string)

  • $playerId (int)

Returns

\SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Interfaces\PETDeckCardInterface | null

public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::pickCards($number, $location, $playerId)
Source

modules/php/Middleware/PETDeckHydrator.php#184

Parameters
  • $number (int)

  • $location (string)

  • $playerId (int)

Returns

\SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Object\PETAgeCard[] | null

public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::pickCardForLocation($fromLocation, $toLocation, $locationArg=0)
Source

modules/php/Middleware/PETDeckHydrator.php#205

Parameters
  • $fromLocation (string)

  • $toLocation (string)

  • $locationArg (int)

Returns

\SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Object\PETAgeCard | null

public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::pickCardsForLocation($number, $fromLocation, $toLocation, $locationArg=0, $noDeckReform=false)
Source

modules/php/Middleware/PETDeckHydrator.php#225

Parameters
  • $number (int)

  • $fromLocation (string)

  • $toLocation (string)

  • $locationArg (int)

  • $noDeckReform (bool)

Returns

\SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Object\PETAgeCard[] | null

public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::moveCard($PETCardToken, $location, $locationArg=0)
Source

modules/php/Middleware/PETDeckHydrator.php#248

Parameters
Returns

void

public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::moveCards($PETAgeCardsArray, $location, $locationArg=null)
Source

modules/php/Middleware/PETDeckHydrator.php#262

Parameters
Returns

void

public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::insertCard($PETCardToken, $location, $locationArg)
Source

modules/php/Middleware/PETDeckHydrator.php#291

Parameters
Returns

void

public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::insertCardOnExtremePosition($PETCardToken, $location, $bOnTop)
Source

modules/php/Middleware/PETDeckHydrator.php#305

Parameters
Returns

void

public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::moveAllCardsInLocation($fromLocation, $toLocation, $fromLocationArg=null, $toLocationArg=0)
Source

modules/php/Middleware/PETDeckHydrator.php#319

Parameters
  • $fromLocation (string)

  • $toLocation (string)

  • $fromLocationArg (int | null)

  • $toLocationArg (int)

Returns

void

public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::moveAllCardsInLocationKeepOrder($fromLocation, $toLocation)
Source

modules/php/Middleware/PETDeckHydrator.php#330

Parameters
  • $fromLocation (string)

  • $toLocation (string)

Returns

void

public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::playCard($PETCardToken)
Source

modules/php/Middleware/PETDeckHydrator.php#340

Parameters
Returns

void

public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::getCard($cardId)
Source

modules/php/Middleware/PETDeckHydrator.php#351

Parameters
  • $cardId (int)

Returns

\SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Interfaces\PETDeckCardInterface

public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::getCards($cardIds)
Source

modules/php/Middleware/PETDeckHydrator.php#362

Parameters
  • $cardIds (array)

Returns

array

public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::getCardsInLocation($location, $locationArg=null, $orderBy=null)
Source

modules/php/Middleware/PETDeckHydrator.php#380

Parameters
  • $location (string)

  • $locationArg (int | null)

  • $orderBy (string | null)

Returns

array | null

public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::countCardInLocation($location, $locationArg=null)
Source

modules/php/Middleware/PETDeckHydrator.php#397

Parameters
  • $location (string)

  • $locationArg (int | null)

Returns

int

public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::countCardsInLocations()
Source

modules/php/Middleware/PETDeckHydrator.php#405

Returns

array

public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::countCardsByLocationArgs($location)
Source

modules/php/Middleware/PETDeckHydrator.php#415

Parameters
  • $location (string)

Returns

array

public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::getPlayerHand($playerId)
Source

modules/php/Middleware/PETDeckHydrator.php#425

Parameters
  • $playerId (int)

Returns

array

public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::getCardOnTop($location)
Source

modules/php/Middleware/PETDeckHydrator.php#441

Parameters
  • $location (string)

Returns

\SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Interfaces\PETDeckCardInterface | null

public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::getCardsOnTop($number, $location)
Source

modules/php/Middleware/PETDeckHydrator.php#453

Parameters
  • $number (int)

  • $location (string)

Returns

array

public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::getExtremePosition($bGetMax, $location)
Source

modules/php/Middleware/PETDeckHydrator.php#470

Parameters
  • $bGetMax (bool)

  • $location (string)

Returns

int

public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::getCardsOfType($deckType, $typeArg)
Source

modules/php/Middleware/PETDeckHydrator.php#481

Parameters
  • $deckType (string)

  • $typeArg (int | null)

Returns

array

public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::getCardsOfTypeInLocation($deckType, $typeArg=null, $location, $locationArg=null)
Source

modules/php/Middleware/PETDeckHydrator.php#500

Parameters
  • $deckType (string)

  • $typeArg (int | null)

  • $location (string)

  • $locationArg (int | null)

Returns

array

public SwHawk\ProgressEvolutionOfTechnologySWH\Modules\Middleware\PETDeckHydrator::shuffle($location)
Source

modules/php/Middleware/PETDeckHydrator.php#516

Parameters
  • $location (string)

Returns

void