Пример #1
0
 public function getRelatedCards()
 {
     $characterRelatedCardRepository = new CharacterRelatedCardRepository();
     $characterRelatedCards = $characterRelatedCardRepository->getByCharakter($this['id']);
     $cardBaseTypes = array();
     foreach ($characterRelatedCards as $characterRelatedCard) {
         $cardBaseTypes[] = $characterRelatedCard['card_base_type'];
     }
     $cardRepository = new CardRepository();
     $cardRepository->setGroupBy('card_base_type');
     return $cardRepository->getByCardBaseType($cardBaseTypes);
 }
Пример #2
0
 /**
  * getter for related characters
  *
  * @return	array<Character>
  */
 public function getRelatedCharacters()
 {
     $characterRelatedCardRepository = new CharacterRelatedCardRepository();
     $characterRelatedCards = $characterRelatedCardRepository->getByCardBaseType($this['card_base_type']);
     $characters = array();
     foreach ($characterRelatedCards as $characterRelatedCard) {
         $characters[] = $characterRelatedCard['charakter'];
     }
     $characterRepository = new CharacterRepository();
     return $characterRepository->getById($characters);
 }