protected function _applySelectOptions(Zend_Db_Table_Select $select, array $options = array()) { if (isset($options[self::OPTION_WHERE])) { foreach ((array) $options[self::OPTION_WHERE] as $where) { $select->where($where); } } if (isset($options[self::OPTION_OR_WHERE])) { foreach ((array) $options[self::OPTION_OR_WHERE] as $orWhere) { $select->orWhere($orWhere); } } if (isset($options[self::OPTION_HAVING])) { foreach ((array) $options[self::OPTION_HAVING] as $having) { $select->having($having); } } if (isset($options[self::OPTION_ORDER])) { foreach ((array) $options[self::OPTION_ORDER] as $order) { $select->order($order); } } $limit = isset($options[self::OPTION_LIMIT]) ? $options[self::OPTION_LIMIT] : null; $offset = isset($options[self::OPTION_OFFSET]) ? $options[self::OPTION_OFFSET] : null; $select->limit($limit, $offset); return $select; }