Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 974341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:25:19+00:00 2026-05-16T03:25:19+00:00

This must be simple, but I can’t seem to find the answer online nor

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T03:25:20+00:00Added an answer on May 16, 2026 at 3:25 am

    How have you retrieved the $Deck? The YAML seems fine.

    The docs give very good examples: Take this schema. When retrieving, you’ll get a collection of objects. The provided sample query:

    //User-Group from a m:n relation through UserGroup Model
    $q = Doctrine_Query::create()
        ->from('User u')
        ->leftJoin('u.Groups g');
    
    $users = $q->fetchArray();
    
    foreach ($users[0]['Groups'] as $group) {
        echo $group['name'];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This must be quite simple but I can't seem to figure this out. I've
This must be simple, but I can't seem to figure it out. I am
This must be very simple. But I just can't seem to find the proper
I must be missing something very simple, but can't find the answer to this.
This is a simple task but i can't seem to figure out how to
I thought this would be fairly simple, but can't seem to figure out how
This must be a simple fix, but I just can't figure it out! I
This must be a dead simple answer but one I just can't seem to
This must be a simple problem but i can't figure out why it's not
I'm sure this must be simple, but I can't figure out how to word

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.