<p>I assume both <code>text</code> and <code>id_str</code> are custom fields?</p>

<pre><code>$event-&gt;params['entry']
</code></pre>

<p>Is an <a href="http://buildwithcraft.com/classreference/models/EntryModel" rel="nofollow">EntryModel</a>, so you should be able to do this:</p>

<pre><code>$entry = $event-&gt;params['entry'];
$idString = $entry-&gt;id_str;
$text = $entry-&gt;text;
</code></pre>

CC BY-SA 3.0
2014-12-02T15:48:58.923Z
I can't do so, but I found a way $event->params['entry']->getFieldValue('tweet')['text']
user1091473
CC BY-SA 3.0
2014-12-02T16:28:50.693Z
Oh, you must be using a plugin that populates 'tweet', then.
Brad Bell
CC BY-SA 3.0
2014-12-02T15:42:25.257Z
2014-12-02T15:42:25.257Z
Brad Bell
<p>It's an array, so:</p>

<pre><code>$entry = $event-&gt;params['entry'];
$text = $entry['text'];
</code></pre>

CC BY-SA 3.0
2015-11-20T21:33:49.317Z
2015-11-20T23:28:32.213Z
2015-11-20T23:28:32.213Z
Daniel Weber
<p>I want to access for particular information which is contained in event object.</p>

<pre><code>public function init()
{
    parent::init();

    craft()-&gt;on('entries.saveEntry', function(Event $event) 
    {

        var_dump($event-&gt;params['entry']);
    });
} 
</code></pre>

<p>it dumps info (brining a needed part)</p>

<pre><code>     ......
["_preppedContent":"Craft\BaseElementModel":private]=&gt;
  array(1) {
    ["tweet"]=&gt;
    array(23) {
      ["created_at"]=&gt;
      string(30) "Thu Nov 13 09:15:40 +0000 2014"
      ["id"]=&gt;
      float(5.3282410346476E+17)
      ["id_str"]=&gt;
      string(18) "532824103464763392"
      ["text"]=&gt;
      string(115) "'The innovation insight you didn't get from Forbes' great blog by @LydiaRagoonanan @nesta_uk http://t.co/PImPVvWeAv"
      ["source"]=&gt;
      string(63) "Hootsuite"
      ["truncated"]=&gt;
      bool(false)
</code></pre>

<p>How can I extract <code>text</code>, <code>id_str</code> information?
Thanks</p>

<php><events>
how to access to event object propereties
# how to access to event object propereties

(Asked by: username_0 on 2014-12-02)

I want to access for particular information which is contained in event object.
public function init()
{
    parent::init();

    craft()->on('entries.saveEntry', function(Event $event) 
    {

        var_dump($event->params['entry']);
    });
} 

it dumps info (brining a needed part)
     ......
["_preppedContent":"Craft\BaseElementModel":private]=>
  array(1) {
    ["tweet"]=>
    array(23) {
      ["created_at"]=>
      string(30) "Thu Nov 13 09:15:40 +0000 2014"
      ["id"]=>
      float(5.3282410346476E+17)
      ["id_str"]=>
      string(18) "532824103464763392"
      ["text"]=>
      string(115) "'The innovation insight you didn't get from Forbes' great blog by @LydiaRagoonanan @nesta_uk http://t.co/PImPVvWeAv"
      ["source"]=>
      string(63) "Hootsuite"
      ["truncated"]=>
      bool(false)

How can I extract text, id_str information?
Thanks

**Tags:** php, events

---

## 2 answers

### Answer by username_1 on 2014-12-02. Score: 2

I assume both text and id_str are custom fields?
$event->params['entry']

Is an EntryModel, so you should be able to do this:
$entry = $event->params['entry'];
$idString = $entry->id_str;
$text = $entry->text;

> **Comments:**
> **username_0**: I can't do so, but I found a way $event->params['entry']->getFieldValue('tweet')['text']  
> **username_1**: Oh, you must be using a plugin that populates 'tweet', then.  

---

### Answer by username_2 on 2015-11-20. Score: -1

It's an array, so:
$entry = $event->params['entry'];
$text = $entry['text'];


---

