Get values in $bean

Hi,everyone.

I'm a new developer in sugarcrm , sorry for my question.

we know :

$parent_id=$bean->parent_id;

can get the parent_id.

I try to get data->value whit $bean->data->value or everything I tried .

"data": {
      "value": "here's value",
      "tags": [],
      "object": {
      "name": "meeting",
      "type": "Meeting",
      "module": "Meetings",
      "id": "c4807fb0-414f-11e9-b5bb-ccfdbfc20594"
},

How can I get the value in PHP code?

 

thanks.

Parents
  • It is not pretty clear, can you kindly explain better what you want to accomplish?

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • Sorry for my bad expression..

    I just want to get what I POST in activities module .

    <?php

    /* File: ./custom/modules/ActivityStream/Activities/HookTest.php */

    class HookTest
    {
    function HookTest($bean, $event, $args)
     {
      $parent_id=$bean->parent_id;
      $parent_type=$bean->parent_type;

      $values=$bean->data;

      $arr=explode(",", $values);
      $arr1=explode(":",$arr[0]);
      $GLOBALS['log']->fatal($arr1[1]."+value");//value 

      $GLOBALS['log']->fatal($parent_id."+parent id");
      $GLOBALS['log']->fatal($values."+data");

     }

    }

    ?>

    This is my bad method now..

    I want to get it directly.

    and this is $bean->data looks like:

    {"value":"post1","tags":[],"object":{"name":"meeting","type":"Meeting","module":"Meetings","id":"c4807fb0-414f-11e9-b5bb-ccfdbfc20594"},"embeds":[]}

     

    Thanks for reply.

Reply
  • Sorry for my bad expression..

    I just want to get what I POST in activities module .

    <?php

    /* File: ./custom/modules/ActivityStream/Activities/HookTest.php */

    class HookTest
    {
    function HookTest($bean, $event, $args)
     {
      $parent_id=$bean->parent_id;
      $parent_type=$bean->parent_type;

      $values=$bean->data;

      $arr=explode(",", $values);
      $arr1=explode(":",$arr[0]);
      $GLOBALS['log']->fatal($arr1[1]."+value");//value 

      $GLOBALS['log']->fatal($parent_id."+parent id");
      $GLOBALS['log']->fatal($values."+data");

     }

    }

    ?>

    This is my bad method now..

    I want to get it directly.

    and this is $bean->data looks like:

    {"value":"post1","tags":[],"object":{"name":"meeting","type":"Meeting","module":"Meetings","id":"c4807fb0-414f-11e9-b5bb-ccfdbfc20594"},"embeds":[]}

     

    Thanks for reply.

Children