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 9036545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:01:33+00:00 2026-06-16T09:01:33+00:00

I’ve got a symfony admin generated module for my Poem class. My poem table

  • 0

I’ve got a symfony admin generated module for my Poem class. My poem table has a foreign_key constraint to my MasterIndex table (user_id). When using the Symfony admin generator, in list mode, it displays a drop-down filter for my user_id. I can change the data that is being displayed by modifying the __toString() method in my MasterIndex class to display the user name instead of the Id.

How can I sort the data that is being displayed in the filter drop-down?

I found this link which proposes a solution, but the peer_method that it uses only seems to work with Propel.

I’m using Doctrine 1.2 with my Symfony 1.4 project.

  • 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-06-16T09:01:35+00:00Added an answer on June 16, 2026 at 9:01 am

    You can find available options for the sfWidgetFormDoctrineChoice here

    * model:        The model class (required)
    * add_empty:    Whether to add a first empty value or not (false by default)
                    If the option is not a Boolean, the value will be used as the text value
    * method:       The method to use to display object values (__toString by default)
    * key_method:   The method to use to display the object keys (getPrimaryKey by default)
    * order_by:     An array composed of two fields:
                      * The column to order by the results (must be in the PhpName format)
                      * asc or desc
    * query:        A query to use when retrieving objects
    * multiple:     true if the select tag must allow multiple selections
    * table_method: A method to return either a query, collection or single object
    

    You can use the order_by option like this: ...->setOption('order_by', array('some_field', 'asc')).

    UPDATE:

    If you want to order by multiple fields you can write a custom query and add multiple order by to it and then use the query or table_method option instead of order_by.

    E.g. (you should write the query into a table class instead):

    $query = Doctrine_Core::getTable('UserTable')->createQuery('u')->orderBy('u.last_name asc, u.first_name asc');
    $this->getWidget('user_id')->setOption('query', $query);
    // if you add some where condition to the query
    // don't forget to set it to the validator as well
    $this->getValidator('user_id')->setOption('query', $query);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Basically, what I'm trying to create is a page of div tags, each has
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
In my XML file chapters tag has more chapter tag.i need to display chapters
I am doing a simple coin flipping experiment for class that involves flipping a

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.