This must be simple, but I can't seem to find the answer online nor figure it out through trial and error.
I have a class Deck and a class Card which have a many to many relationship with each other. I'm fairly confident that I am adding Cards to Decks correctly (they are being written correctly into the DB, junction table and all), but when I try to access a Deck's cards by using:
$Deck->Cards
, it doesn't seem to be returning anything. The relevant schema (in YAML) is here:
**from Card model**
relations:
Decks:
class: Deck
foreignAlias: Cards
refClass: DeckCard
local: card_id
foreign: deck_id
**from Deck model**
relations:
Cards:
class: Card
foreignAlias: Decks
refClass: DeckCard
local: deck_id
foreign: card_id
DeckCard:
columns:
deck_id:
type: integer
primary: true
card_id:
type: integer
primary: true
Thanks so much. I'm sure this is easy and I'm overlooking something simple.