title: Pimcore: Retrieve Single Object List by Multiple Class Types
body: <p>I currently have a controller that pulls objects from the Pimcore Objects exactly how the sample data demonstrated.</p>
  
  <p>What we need to accomplish with this build, is to allow for a "Featured" category to be assigned to any NewsArticle object or EventsArticle object. We need to pull a combined list from both <code>NewsArticle</code> and <code>EventsArticle</code> objects that also have the <code>Featured</code> category assigned to them. We need to keep track of all the IDs returned in this list, and exclude them from the single track lists so that they aren't displayed twice on the same page.</p>
  
  <p>These are our two single track lists which work as expected, limited by custom properties that live on the document.</p>
  
  <p><strong>Requirements:</strong></p>
  
  <ul>
  <li>Filter by <code>featured</code> category.</li>
  <li>Prevent any post from being listed twice.</li>
  <li>Able to sort by date <code>asc</code> or <code>desc</code>.</li>
  </ul>
  
  <hr>
  
  <pre><code>// TODO: List Featured News and Events Objects...
  // $this-&gt;view-&gt;featured = $featuredList-&gt;getObjects();
  
  // List News Objects...
  $newsList = new Object\NewsArticle\Listing();
  $newsList-&gt;setOrderKey( "date" );
  $newsList-&gt;setOrder( "DESC" );
  $newsList-&gt;setLimit( $this-&gt;document-&gt;getProperty( 'newsLimit' ) );
  // TODO: Exclude any IDs in $this-&gt;view-&gt;featured
  $this-&gt;view-&gt;news = $newsList-&gt;getObjects();
  
  // List Events Objects...
  $eventsList = new Object\EventsArticle\Listing();
  $eventsList-&gt;setOrderKey( "date" );
  $eventsList-&gt;setOrder( "DESC" );
  $eventsList-&gt;setLimit( $this-&gt;document-&gt;getProperty( 'eventsLimit' ) );
  // TODO: Exclude any IDs in $this-&gt;view-&gt;featured
  $this-&gt;view-&gt;events = $eventsList-&gt;getObjects();
  </code></pre>