@@ -253,17 +253,35 @@ protected function prepareUpdate($table, $data, $where = null, $limit = null) {
253253 }
254254
255255 /**
256- * Retrieve the distinct values of the given resource field .
256+ * Retrieve the distinct values of the given database column .
257257 *
258258 * @param string $table
259- * @param string $field
260- * @param array $filter [optional]
261- * @param array $order [optional]
262- * @param int $limit [optional]
263- * @param int $offset [optional]
259+ * @param string $column
260+ * @param array $filter [optional]
261+ * @param array $order [optional]
262+ * @param int $limit [optional]
263+ * @param int $offset [optional]
264+ * @return array
265+ */
266+ public function distinct ($ table , $ column , array $ filter = array (), $ order = array (), $ limit = null , $ offset = 0 ) {
267+ $ query = $ this ->prepareSelect ($ table , "DISTINCT $ column " , $ this ->prepareWhere ($ filter ), $ this ->prepareOrderBy ($ order ), $ this ->prepareLimit ($ limit , $ offset ));
268+
269+ return $ this ->connection ->query ($ query )->data ;
270+ }
271+
272+ /**
273+ * Retrieve all values of the given database column.
274+ *
275+ * @param string $table
276+ * @param string $column
277+ * @param array $filter [optional]
278+ * @param array $order [optional]
279+ * @param int $limit [optional]
280+ * @param int $offset [optional]
281+ * @return array
264282 */
265- public function distinct ($ table , $ field , array $ filter = array (), $ order = array (), $ limit = null , $ offset = 0 ) {
266- $ query = $ this ->prepareSelect ($ table , "DISTINCT $ field " , $ this ->prepareWhere ($ filter ), $ this ->prepareOrderBy ($ order ), $ this ->prepareLimit ($ limit , $ offset ));
283+ public function listing ($ table , $ column , array $ filter = array (), $ order = array (), $ limit = null , $ offset = 0 ) {
284+ $ query = $ this ->prepareSelect ($ table , "$ column " , $ this ->prepareWhere ($ filter ), $ this ->prepareOrderBy ($ order ), $ this ->prepareLimit ($ limit , $ offset ));
267285
268286 return $ this ->connection ->query ($ query )->data ;
269287 }
0 commit comments