Answers.Body: <p>This gives you an <a href="https://craftcms.com/docs/templating/entrymodel" rel="nofollow">EntryModel</a>:</p>
  
  <pre><code>$entryModel = $event-&gt;params['entry'];
  </code></pre>
  
  <p>This will give you an array of <a href="https://craftcms.com/docs/templating/assetfilemodel" rel="nofollow">AssetFileModels</a>:</p>
  
  <pre><code>$assetFileModels = $entryModel-&gt;myAssetFieldHandle
  </code></pre>
  
  <p>You can loop through them like so:</p>
  
  <pre><code>foreach ($assetFileModels as $assetFileModel)
  {
      $url = $assetFileModel-&gt;getUrl();
  }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-07T17:06:28.173Z
Answers.LastActivityDate: 2016-06-07T17:06:28.173Z
Answers.UserDisplayName: Brad Bell
Answers.Body: <p>What about <code>$event-&gt;params['entry']-&gt;{fieldname}</code></p>
  
  <p>Wouldn't that be enough?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-07T14:45:55.680Z
Answers.LastActivityDate: 2016-06-07T14:45:55.680Z
Answers.UserDisplayName: Tom De Smet
Body: <p>I'm listening on an entries save event with:</p>
  
  <pre><code>craft()-&gt;on('entries.saveEntry', function(Event $event) {
    //$event-&gt;params['entry']); -&gt; passes to function 
  });
  </code></pre>
  
  <p>How can I assess assets that are also part of that saved entry?</p>
  
  <p><code>$event-&gt;params['entry']-&gt;getContent()-&gt;{fieldname}</code> doesn't give me the array with information I was hoping for.</p>
  
Tags: <plugin-development><assets><events>
Title: How do I access an asset field in the 'onSaveEntry' event?
ThreadText: # How do I access an asset field in the 'onSaveEntry' event?
  
  (Asked by: username_0 on 2016-06-07)
  
  I'm listening on an entries save event with:
  
  ```
  craft()->on('entries.saveEntry', function(Event $event) {
    //$event->params['entry']); -> passes to function 
  });
  
  ```
  
  How can I assess assets that are also part of that saved entry?
  
  `$event->params['entry']->getContent()->{fieldname}` doesn't give me the array with information I was hoping for.
  
  **Tags:** plugin-development, assets, events
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2016-06-07. Score: 1 | Accepted answer
  
  This gives you an [EntryModel](https://craftcms.com/docs/templating/entrymodel):
  
  ```
  $entryModel = $event->params['entry'];
  
  ```
  
  This will give you an array of [AssetFileModels](https://craftcms.com/docs/templating/assetfilemodel):
  
  ```
  $assetFileModels = $entryModel->myAssetFieldHandle
  
  ```
  
  You can loop through them like so:
  
  ```
  foreach ($assetFileModels as $assetFileModel)
  {
      $url = $assetFileModel->getUrl();
  }
  
  ```
  
  
  ---
  
  ### Answer by username_2 on 2016-06-07. Score: -1
  
  What about `$event->params['entry']->{fieldname}`
  
  Wouldn't that be enough?
  
  
  ---
  
  