/**
  * Find prices for a given product and collection
  *
  * @param IsotopeProduct|Standard                    $objProduct
  * @param IsotopeProductCollection|ProductCollection $objCollection
  * @param array                                      $arrOptions
  *
  * @return IsotopePrice
  */
 public static function findByProductAndCollection(IsotopeProduct $objProduct, IsotopeProductCollection $objCollection, array $arrOptions = array())
 {
     $t = static::$strTable;
     $arrOptions['column'] = array();
     $arrOptions['value'] = array();
     if ($objProduct->hasAdvancedPrices()) {
         $time = \Date::floorToMinute($objCollection->getLastModification());
         $arrGroups = static::getMemberGroups($objCollection->getRelated('member'));
         $arrOptions['column'][] = "{$t}.config_id IN (" . (int) $objCollection->config_id . ",0)";
         $arrOptions['column'][] = "{$t}.member_group IN(" . implode(',', $arrGroups) . ")";
         $arrOptions['column'][] = "({$t}.start='' OR {$t}.start<'{$time}')";
         $arrOptions['column'][] = "({$t}.stop='' OR {$t}.stop>'" . ($time + 60) . "')";
         $arrOptions['order'] = "{$t}.config_id DESC, " . \Database::getInstance()->findInSet('member_group', $arrGroups) . ", {$t}.start DESC, {$t}.stop DESC";
     } else {
         $arrOptions['column'][] = "{$t}.config_id=0";
         $arrOptions['column'][] = "{$t}.member_group=0";
         $arrOptions['column'][] = "{$t}.start=''";
         $arrOptions['column'][] = "{$t}.stop=''";
     }
     if ($objProduct->hasVariantPrices() && !$objProduct->isVariant()) {
         $arrIds = $objProduct->getVariantIds() ?: array(0);
         $arrOptions['column'][] = "{$t}.pid IN (" . implode(',', $arrIds) . ")";
     } else {
         $arrOptions['column'][] = "{$t}.pid=" . ($objProduct->hasVariantPrices() ? $objProduct->id : $objProduct->getProductId());
     }
     $objResult = static::find($arrOptions);
     return null === $objResult ? null : $objResult->filterDuplicatesBy('pid');
 }