/** * Getting all the preferred locations * * @param Product $product * @param PreferredLocationType $type * @param string $activeOnly * @param string $pageNo * @param unknown $pageSize * @param unknown $orderBy * @param unknown $stats * @return Ambigous <Ambigous, multitype:, multitype:BaseEntityAbstract > */ public static function getPreferredLocations(Product $product, PreferredLocationType $type = null, $activeOnly = true, $pageNo = null, $pageSize = DaoQuery::DEFAUTL_PAGE_SIZE, $orderBy = array(), &$stats = array()) { $where = array('productId = ? '); $params = array($product->getId()); if ($type instanceof PreferredLocationType) { $where[] = 'typeId = ?'; $params[] = $type->getId(); } return self::getAllByCriteria(implode(' AND ', $where), $params, $activeOnly, $pageNo, $pageSize, $orderBy, $stats); }