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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:43:51+00:00 2026-05-25T14:43:51+00:00

I try to realize such a effect in a form of creating a new

  • 0

I try to realize such a effect in a form of creating a new category : I add a ‘select list’ to the form to show all the category i have created ,so I tried:

> /**
>      * @var string $parent
>      *
>      * @ORM\ManyToOne(targetEntity="ProductCategory")
>      * @ORM\JoinColumn(name="product_category_id",
> referencedColumnName="id")  
>      */
>      
>     private $parent;

then i want to realize that:if the checkbox isRoot is selected ,the parent option is set “root”,so i wrote:

> if($entity->getIsRoot()){
>             $entity ->setParent('root');
>         }

However,it give me a exception:
Expected argument of type “object”, “string” given

what’s the matter? How to solve the problem.

Thanks in advance! 🙂

  • 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-25T14:43:52+00:00Added an answer on May 25, 2026 at 2:43 pm

    Looks like your problem is that the

    ->setParent()
    

    expects an object of type Category.

    Since you don’t want to select a parent category for root nodes, you should not set the parent.

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

Sidebar

Related Questions

I try to realize a link (in fact many links) that update a table
try { // CompareRecord record = new CompareRecord(); Connection conn = new CompareRecord().getConection(eliteddaprd,eliteddaprd,192.168.14.104,1521); ResultSet
Try to see which cast is faster (not necessary better): new c++ case or
I try to realize simple code on perl which should just get/send messages from/to
I try to realize a little game project to dive deeper into OO programming
I realize that this is probably a very basic question, but I have spent
I have such code to read a text file using BufferedReader : BufferedReader reader=null;
I try to realize that, when the user click on a button (custom one),
How do you realize a try-catch-finally idiom in smalltalk? I see there is on:do:
I have a multidimensional array built from Strings that is initially created with the

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.