ssossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

This topic contains 5 replies, has 2 voices, and was last updated by Spurgeon Spurgeon 2 years, 11 months ago.

  • Creator
    Topic
  • #6436
    Spurgeon
    Spurgeon
    Participant

    Hi,

    We need to create around 200 User groups namely XYZ0001, XYZ0002 and so on..

    I guess this can be achieved easily pro grammatically with a for loop, in a action function called by a controller.

    Guess that this can be a modification or overriding User Bundle’s GroupController.php to include a custom action function and by implementing appropriate routes.

    Could some one kindly point me to / help with the details as to how to implement this and what the code can be?

    Thanks!
    warm regards
    Spurgeon

Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
    Replies
  • #6464
    Yevhen Shyshkin
    Yevhen Shyshkin
    Oro Core

    Hello, spurgeonbj.

    Well, you can do that in controller – you can look at demo data fixture for example

    But it would be better to create data fixture for that and load it from console – this way you can easily reuse it and have all changes in one place.

    #6490
    Spurgeon
    Spurgeon
    Participant

    Hi Yevhen,

    Greetings!
    Thanks a ton for the quick & kind response and for the pointer to the best practice. Will do as you suggest!

    Warm regards and gratitude,
    Spurgeon

    #6532
    Spurgeon
    Spurgeon
    Participant

    Hi @Yevhen,

    Greetings!

    After saving our custom fixtures to lets say to vendor/oro/crm/src/OroCRM/Bundle/DemoDataBundle/Migrations/Data/Demo/ORM/LoadMyGroupData.php

    how to load this from console?

    is it using

    ?

    How to load only this fixture, I dont want to add other demo data or loose other data.

    Thank you!
    warm regards
    Spurgeon

    #6533
    Yevhen Shyshkin
    Yevhen Shyshkin
    Oro Core

    > How to load only this fixture, I dont want to add other demo data or loose other data.

    1) You can put it into separate directory (probably not in Migrations), and then run doctrine:fixtures:load with your directory as option “–fixtures” and “–append” option to do not purge DB.

    2) If this fixture should be part of your regular installation, then you can move this fixture to Migration/Data/ORM directory and then run oro:migration:data:load to load your fixture.

    #6534
    Spurgeon
    Spurgeon
    Participant

    Hi Yehven,

    Greetings!

    Thanks a lot for the quick and kind response.

    Warm regards and gratitude,
    Spurgeon

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

You must be logged in to reply to this topic.