public static function doKeyBy(&$array, $index) { $array = \UArray::keyBy($array, $index); }
public function fetchIdsByRelatedThroughTable($table, $field, $relatedField, $related, $filterList = []) { if (!$related->exists()) { return array(); } $sql = 'SELECT ' . $field . ' FROM ' . $table . ' WHERE ' . $relatedField . '=' . $related->id; foreach ($filterList as $key => $value) { $sql .= ' AND ' . $key . '=' . $value; } $request = new Request($sql); $existing = $request->execute(); return array_keys(\UArray::keyBy($existing, $field)); }