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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:50:06+00:00 2026-05-27T05:50:06+00:00

I am a newbie trying to create a simple (in theory) CRUD application using

  • 0

I am a newbie trying to create a simple (in theory) CRUD application using symfony 1.4. I am trying to use filters on my index page so that the user can select the records thay want to view rather than the entire list.

I followed the instructions I found here http://www.michelsalib.com/2010/10/how-to-use-filters-on-custom-fields (although I am not using custom fields, only ones that appear in the table and are listed in the Base--FormFilter class). This works perfectly for all my fields except the one that is a foreign key.

When I try to filter on any of these values, the validation fails.
The filter widget is:

new sfWidgetFormDoctrineChoice(array(
  'model' => $this->getRelatedModelName('EatLocations'), 
  'add_empty' => true))

and the validator is:

new sfValidatorDoctrineChoice(array(
  'required' => false, 
  'model' => $this->getRelatedModelName('EatLocations'), 
  'column' => 'loc_abbrev')

I thought the problem was that the validator was pointing to the wrong column, but when I set ‘column’=>”location_id’ (the column the foreign key points to) I get this error:
You must define a “addEaUnitColumnQuery” method to be able to filter with the “ea_unit” field.

I have seen some examples of how to write this method, but they seem overly complicated, and I’m not sure how to apply this to my table. Does anyone know if there is a simpler way to solve this?

  • 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-27T05:50:06+00:00Added an answer on May 27, 2026 at 5:50 am

    SOLVED:

    Why are you specifying the ‘column’ option? – greg0ire

    The auto-generated code in the Base class specified the column, so I had to override it.

    I solved the probelm by setting the column in the validator to ‘location_id’ and then
    writing the following function…

    public function addEaUnitColumnQuery($query, $field, $values)
      {
         if ($values['ea_unit']!= NULL) {
            $query->addWhere('ea_unit_id = ?', $values['ea_unit']);
         }
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a simple framed page that reloads each x seconds and
I am a newbie trying to create a sample web application using; MySQL Java
I'm a complete newbie in OCaml and trying to create a simple console program.
I'm using Java Logging API in a simple Servlet application that uses Maven and
I'm a liferay newbie. I'm trying to write a simple php app that echos
I am a LINQ newbie trying to use it to acheive the following: I
Because I am a newbie I am trying to log out any errors that
Newbie question since I'm not up to speed using maven at all. I'm trying
I am trying to use ctags with VIM, and I am a newbie to
Newbie question. I've created a very simple LoginForm class in symfony. It checks if

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.