ssossossosso

Forums

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

This topic contains 1 reply, has 1 voice, and was last updated by  andytnumiko 1 year, 8 months ago.

  • Creator
    Topic
  • #15832

    andytnumiko
    Participant

    Hi,

    I need to access context data to use it directly. It looks like one way of doing that is (example from ActivityContextController):


    $className = $this->get('oro_entity.routing_helper')->resolveEntityClass($activity);
    $result = $this->getManager()->getActivityContext($className, $id);

    2 questions:

    1. Is this the best way?
    2. If the activity is Task, what should $activity (the $entityName parameter of resolveEntityClass()) in the above example be? I’ve tried every variation I can think of but always get an EntityAliasNotFoundException.

    thanks

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #15892

    andytnumiko
    Participant

    The best way seems to be to use the methods of ExtendActivity.

    e.g.


    $contextEntities = $activity->getActivityTargets(Type::class);

    where Type is the classname of the related data you want to access.

    Or getActivityTargetEntities() gets all context for the entity.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.