Forums

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

This topic contains 8 replies, has 2 voices, and was last updated by  fred33 11 months, 4 weeks ago.

  • Creator
    Topic
  • #24420

    fred33
    Participant

    Hi,

    All is in the title…I just want to extend an existing entity with a selected field..or is there a way to update the source code when creating this field with the GUI

Viewing 8 replies - 1 through 8 (of 8 total)
  • Author
    Replies
  • #24566
    Mike Kudelya
    Mike Kudelya
    Oro Core

    Hi

    You can do this via migration or just add Multi-Select field from this section ‘System -> Entities -> Entity Management’. Fifth parameter of addEnumField function is isMultiple.

    #24571

    fred33
    Participant

    I created my multiselect field via gui but this is not the right way to do it because I need it for one of my bundles. How to declare a multiselect field in an entity.php???

    #24579
    Mike Kudelya
    Mike Kudelya
    Oro Core

    Hi

    Your field have already declared in entity file. For example Opportunity entity contains ‘status’ field, but you can’t find it in vendor/oro/crm/src/OroCRM/Bundle/SalesBundle/Entity/Opportunity.php, because Opportunity.php extends from ExtendOpportunity and ExtendOpportunity replaces with app/cache/[cache dir]/oro_entities/Extend/Entity/EX_OroCRMSalesBundle_Opportunity.php where you can find status property. If you want to access to your field or override function try to extend original entity (if it exists) or access to it directly from your entity.
    What is your final goal ? What do you want to do ?

    #24580

    fred33
    Participant

    I want to extend the entity calendar_event with two multi-select fields to be able to reuse them in a javascript. I have done it through the GUI but I can not access it when I write my code. I know how to extend entity but i don’t know how to declare multi-selected field

    #24581
    Mike Kudelya
    Mike Kudelya
    Oro Core

    You can access to field usual approach $calendarEvent->getYourMultiSelectName()

    #24582

    fred33
    Participant

    Even if I do not see it in the source code ?

    #24584
    Mike Kudelya
    Mike Kudelya
    Oro Core

    Yes, new extended fields won’t appear directly in the CalendarEvent. Try to find your property and getters/setters in app/cache/[dev or prod]/oro_entities/Extend/Entity/EX_OroCalendarBundle_CalendarEvent.php

    #24588

    fred33
    Participant

    Ok i find it

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

You must be logged in to reply to this topic.

ssossossosso