I want to access for particular information which is contained in event object.

public function init()

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


it dumps info (brining a needed part)

  array(1) {
    array(23) {
      string(30) "Thu Nov 13 09:15:40 +0000 2014"
      string(18) "532824103464763392"
      string(115) "'The innovation insight you didn't get from Forbes' great blog by @LydiaRagoonanan @nesta_uk http://t.co/PImPVvWeAv"
      string(63) "Hootsuite"

How can I extract text, id_str information? Thanks


I assume both text and id_str are custom fields?


Is an EntryModel, so you should be able to do this:

$entry = $event->params['entry'];
$idString = $entry->id_str;
$text = $entry->text;
  • I can't do so, but I found a way $event->params['entry']->getFieldValue('tweet')['text'] Dec 2 '14 at 15:48
  • Oh, you must be using a plugin that populates 'tweet', then.
    – Brad Bell
    Dec 2 '14 at 16:28

It's an array, so:

$entry = $event->params['entry'];
$text = $entry['text'];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.