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

  • SEARCH
  • Home
  • 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 6200959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:27:52+00:00 2026-05-24T04:27:52+00:00

tl;dr: I need to show data from two different tables in the list view

  • 0

tl;dr: I need to show data from two different tables in the list view of the Symfony admin generator (preferably via a JOIN statement)

I’m using the sfDoctrineGuardPlugin to manage the users of my app. Each user also has their own profile that they can fill out. The schema (schema.yml) for the profile table looks like this:

sfGuardUserProfile:
  connection: doctrine
  tableName: sf_guard_user_profile
  columns:
    sf_guard_user_id: integer(8)
    client_id: string(128)
  relations:
    sfGuardUser:
      local: sf_guard_user_id
      foreign: id
      foreignType: one
      onDelete: CASCADE

Right now table is a client_id and a foreign key to the id column on the sfGuardUser table.
(Yes, I know I need an id column in there just for DB accessibility, and more is coming later)

I’ve created an admin for my profile table using the Symfony admin generator. I would like my list view on the admin to look like this (generator.yml):

config:
  ...
  list:
    title:   Clients
    display: [client_id, sf_guard_user_id, username]
    table_method: retrieveProfileList

However, my username column does not work, and I receive a Doctrine_Record_UnkownPropertyException of:

Unknown record property / related component "username" on "sfGuardUserProfile"

I was hoping a custom table_method to populate the data for the list view would help me, but my table method (in lib/model/sfGuardUserProfileTable.class.php) does not seem to help. I followed an example in the Symfony Book, and this is the method:

public static function retrieveProfileList(Doctrine_Query $q)
{
  $rootAlias = $q->getRootAlias();

  $q->leftJoin($rootAlias . '.sfGuardUser id');

  return $q;
}

Any ideas on how to have the Symfony admin generator display a list view based on a join? Or, alternatively, how to pull from a separate model?

  • 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-24T04:27:52+00:00Added an answer on May 24, 2026 at 4:27 am

    I have answered my own question!

    I changed the join method on my sfGuardUserProfileTable class to something I could better understand (thanks to this helpful link):

    public static function retrieveProfileList(Doctrine_Query $q)
    {
      return $q->select('r.*, u.username')
              ->leftJoin('r.sfGuardUser u');
    }
    

    And threw in a getUsername method in my sfGuardUserProfile model class

      public function getUsername()
      {
          return $this->sfGuardUser->username;
      }
    

    Thanks for being my rubber duck, SO!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to be able to call data from a different model - not
Before you ask, yes I need to show this much data. stl() requires two
I need to show some information in a graph, the data is held in
I need help with my loop. In each div, I want to show two
Given two identical widgets with different data, A and B, when the data for
I am trying to develop a BlackBerry application that will show data from an
I have a contact form with two radio buttons. But I need to show
I have three databases on three different servers that I need to join and
I need to show a Master/Child data in a page and I have used
I have two strings that I need to pull data out of but can't

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.