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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:30:54+00:00 2026-06-10T14:30:54+00:00

I created an embedded collection of another entity in a form, the idea would

  • 0

I created an embedded collection of another entity in a form, the idea would be that when you edit or erase up to ‘demand’ also would edit the ‘products’ that belong to it, my creating form is ok, but the editing it gives the error :

Catchable Fatal Error: Argument 1 passed to MaisAlimentos\DemandaBundle\Entity\Demanda::setProdutosDemanda() must be an instance of Doctrine\Common\Collections\ArrayCollection, instance of Doctrine\ORM\PersistentCollection given, called in /var/www/maa/vendor/symfony/src/Symfony/Component/Form/Util/PropertyPath.php on line 347 and defined in /var/www/maa/src/MaisAlimentos/DemandaBundle/Entity/Demanda.php line 130

I read on some forums, the solution is remove type of the setter, I got other error:

Catchable Fatal Error: Object of class Doctrine\ORM\PersistentCollection could not be converted to string in /var/www/maa/src/MaisAlimentos/DemandaBundle/Entity/Demanda.php line 136

my code

http://pastebin.com/WeGcHyYL

  • 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-10T14:30:55+00:00Added an answer on June 10, 2026 at 2:30 pm

    OK, so you’ve found the solution for your original problem.

    The second one comes from a typo/copy-paste error.

    In the line 162 on your pastebin code:

    $this->$produtosDemanda = $produtosDemanda;
    

    should be

    $this->produtosDemanda = $produtosDemanda;
    

    So no $ sign after $this->.

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

Sidebar

Related Questions

I created a graphic in Flash CS4 that contains text. I embedded the appropriate
On an embedded type system, I have created a Small Object Allocator that piggy
I have created a collection form in symfony 1.4 and Propel 1.5 and everything
Given this doc form a collection of Courses I would like to pick a
I have created a form in which i embed another form. My question is
I have created a web application with a Silverlight project embedded in it, using
I've embedded Python in my C++ application, and I've created several C functions which
I've created a HTML page to enter data to a MySQL database. I've embedded
I have been attempting to develop an embedded webserver within an application that I
I have a webapp where I'm created an embedded document for educations. The job

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.