title: Magento 1.7 Add Multiple Attributes to Collection Filter
body: <p>In my function that grabs a collection of products, I am going to filter by an unknown number of attributes so I cant hardcode them in. My function is the one below:</p>
  
  <pre><code>public function getAssociatedProducts()
      {
  
          $parameters = $this-&gt;getRequest()-&gt;getPost();               
          $product = Mage::getModel('catalog/product')-&gt;load($parameters['parent_id']);
          $grouped = Mage::getModel('catalog/product_type_grouped');
  
  
          $collection = $grouped-&gt;getAssociatedProductCollection($product)
              -&gt;addAttributeToSelect('*')
              -&gt;addFilterByRequiredOptions()
              -&gt;setPositionOrder()
              -&gt;addStoreFilter($grouped-&gt;getStoreFilter($product))
              -&gt;addAttributeToFilter('status', array('in' =&gt; $grouped-&gt;getStatusFilters($product)));          
              // I need to do another addAttributeToFilter on this collection for the $parameters variable above. But the number of paramters I will need to check is unknown.
  
  
          return $collection;
  
      }
  </code></pre>
  
  <p>Can addAttributeToFilter handle an array of attributes? The number of attributes that the $parameters variable will bring is unknown and I can only figure out how to do them one at a time but I need it to be flexible enough to handle adding up to 10 attributes to the filter.</p>
  
  <p>Thank you!  </p>
  
  <p>I should add that the array of paramters might look like this:</p>
  
  <pre><code>galco_weapon_list =&gt; 3602,
  product_color =&gt; 1595,
  weapon_draw_hand =&gt; 2700
  </code></pre>
  
  <p>The array above will always be different.</p>