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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:32:24+00:00 2026-06-04T11:32:24+00:00

I have some scenario like below : /** * @ORM\Entity * @ORM\Table(name=role) */ class

  • 0

I have some scenario like below :

/**
 * @ORM\Entity
 * @ORM\Table(name="role")
 */
class Role
{
    /**
     * @ORM\OneToMany(targetEntity="RolesFeatures", mappedBy="role", cascade={"all"})
     **/
    private $rolesFeatures;
}

In my index file I would like to get them:

{{ role.rolesFeatures.getId() }}

I get this :

 An exception has been thrown during the rendering of a template ("Catchable Fatal
 Error: Object of class Doctrine\ORM\PersistentCollection could not be converted to string
 in C:\wamp\www\PMI_sf2\app\cache\dev\twig\63\81\679fca1c2da64d0ebbcd5661bc6d.php line 99")
 in PMIHomePagesBundle:HomePages:mainHome.html.twig at line 49.

How I can Cast Doctrine\ORM\PersistentCollection to it real object class ?

  • 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-04T11:32:25+00:00Added an answer on June 4, 2026 at 11:32 am

    rolesFeatures is an array so you need to iterate over it. Something like:

    {% for roleFeature in role.rolesFeatures %}
        {{ roleFeature.id }}
    {% endfor %}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table that contains some data given below. It uses a tree
i have code like below. Base is the base class and D1, D2, D3
I have some code below. This code is a basic push/pop stack class that
My scenario is that I have some payment transaction data in MySQL and some
We have a scenario where some .NET code is attempting to access the current
Skip to the specific question as needed. Some background: The scenario: I have a
Scenario: I have a view that has some DataTemplate resources <DataTemplate x:Key=myDragCueTemplate> <Border Background=Blue
Here is the scenario: I have a visual that displays some data The data
Scenario :- I have to call MYSQL stored procedure from PHP and do some
Scenario I have a windows service written in C# that performs some processing based

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.