Announcement

Collapse
No announcement yet.

How can I instantiate a entity in other entity controller?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How can I instantiate a entity in other entity controller?

    Hi!

    I want instantiate a entity in other diferent entity controller. For example, instantiate
    Opportunity entity in Account controller. How can I do it? Thanks!

  • #2
    Use $this->getEntityManager(). There is a documentation

    Comment


    • #3
      I am using "$this->getEntityManager()->getRepository('Opportunity')->get('576c068c380779fb7')" and I'm sure that these object exists in database. But it gives a Error, that said it is null.
      I was seen the documentation and I don't get the solution.

      Sorry for the inconvenience

      Comment


      • #4
        Is this record ("576c068c380779fb7") is not deleted?
        Job Offers and Requests

        Comment


        • #5
          Of course, This is the id of the record Opportunity and it exists in my database, but this code return null. Idea??

          Comment


          • #6
            I did it

            Comment

            Working...
            X