Answers.Body: <p>I've found that it was not the best way to to it.<br>
  I used the following code and it cleared my problem.</p>
  
  <pre><code>$criteria = craft()-&gt;elements-&gt;getCriteria(ElementType::Category);
  $criteria-&gt;group = 'productEnvironment';
  $entries = $criteria-&gt;find();
  
  foreach ($entries as $entry) {
      echo $entry-&gt;title . '&lt;br&gt;';
      echo $entry-&gt;mountingPreview[0] . '&lt;br&gt;'; // Dirty get the first assets
  }
  </code></pre>
  
  <p>Hope this helps someone</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-09T17:40:26.993Z
Answers.LastActivityDate: 2015-03-09T17:40:26.993Z
Answers.UserDisplayName: Nicolas Binet
Body: <p>When I get a CategoryGroup with the following  </p>
  
  <pre><code>$category = craft()-&gt;categories-&gt;getGroupByHandle('productEnvironment');
  </code></pre>
  
  <p>I Just can't figure out how to get the categories inside this category.<br>
  Is-there any kind of relation/method ?</p>
  
  <p>Thanks</p>
  
  <p>Nicolas</p>
  
Tags: <categories>
Title: Get all categories from a CategoryGroupModel through API
ThreadText: # Get all categories from a CategoryGroupModel through API
  
  (Asked by: username_0 on 2015-03-09)
  
  When I get a CategoryGroup with the following
  
  ```
  $category = craft()->categories->getGroupByHandle('productEnvironment');
  
  ```
  
  I Just can't figure out how to get the categories inside this category.  
  Is-there any kind of relation/method ?
  
  Thanks
  
  username_0
  
  **Tags:** categories
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2015-03-09. Score: 1 | Accepted answer
  
  I've found that it was not the best way to to it.  
  I used the following code and it cleared my problem.
  
  ```
  $criteria = craft()->elements->getCriteria(ElementType::Category);
  $criteria->group = 'productEnvironment';
  $entries = $criteria->find();
  
  foreach ($entries as $entry) {
      echo $entry->title . '<br>';
      echo $entry->mountingPreview[0] . '<br>'; // Dirty get the first assets
  }
  
  ```
  
  Hope this helps someone
  
  
  ---
  
  