OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform OroPlatform – Programming Questions Call to relation when I added my migration

This topic contains 2 replies, has 2 voices, and was last updated by  thinh2010 6 years, 8 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #34430

    thinh2010
    Participant

    Hi,

    I want to add more fields in Business Unit entity. So that I use migration to do that.
    I added the relationship OneToMany, named ‘rooms’
    Now in twig, I want to get all rooms of my business unit, I called entity.rooms but not success because in business unit entity class dont have getRooms() function.
    The question is how can I get the list of rooms?
    I dont want to use owner ExtendScope::OWNER_CUSTOM, because the twig display rooms is not the view detail of business unit.

    Thanks,

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #34431

    igalayev
    Participant

    Hi, after relationship is added via migration then getter and setter should be generated in ExtendBusinessUnit class.

    In dev environment you should be able to see them in /app/cache/dev/oro_entities/Extend/Entity/EX_OroOrganizationBundle_BusinessUnit.php

    Make sure that after migration was run updated file is loaded (e.g. restart consumer, clear cache).

    #34432

    thinh2010
    Participant

    Hi,

    Yes, my bad, I clear the cache and problem resolve. Thanks

Viewing 2 replies - 1 through 2 (of 2 total)

The forum ‘OroPlatform – Programming Questions’ is closed to new topics and replies.

Back to top