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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:24:08+00:00 2026-06-10T19:24:08+00:00

I have a form using this class type: class DespesasContainerType extends AbstractType { public

  • 0

I have a form using this class type:

class DespesasContainerType extends AbstractType
{
    public function buildForm(FormBuilder $builder, array $options)
    {
        $builder
            ->add('despesas', 'collection', array(
                'type' => new DespesasFamiliasType(),
                'by_reference' => false,
            ))
        ;
    }

    // ...
}

This way it shows all items in the despesas attribute of the object.

Is there a way to filter which items to use? Something similar to the query_builder option on the entity field type.

  • 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-10T19:24:09+00:00Added an answer on June 10, 2026 at 7:24 pm

    No way from FormTypeInterface, but you can filter this collection before passing it to the Form.

    Another tricky tip :

    Define a public getter like getFilteredDespeas on your Entity that returns the filtered list of despeas. In your Form, just call the field filteredDespeas instead of despeas. This involves that you specifically manage the form binding, by adding a public setFilteredDespeas to your entity, or any other way…

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

Sidebar

Related Questions

In my ASP MVC 3 application, I have this form @using (Html.BeginForm()) { <input
I have form in my page, I am using ajax.beginform(). Inside this form I
I have an ASP.NET MVC form laid out something like this: @using (Html.BeginForm(null, null,
I have a webpage with a form, which looks kinda like this: @using (Html.BeginForm(MyAction,
this is a simple question. I have a form that is being validated using
My problem is this one, I am using Sharepoint 2010, I have a form
I have started using Simple-form and Bootstrap and I have tried to follow this
I have a dynamic form that is to be displayed using an iPad. This
I am using C# with a Windows Application Form. In this I have a
I have a class and a set of IEnumerables that are using this class

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.