method getValuesDesc documentation in bbn\Db\Languages\Sql

function(array $where, array $cfg, &$others = []) { if (!empty($where['conditions'])) { foreach ($where['conditions'] as &$f){ // It's an imbricated condition if (isset($f['logic'], $f['conditions']) && \is_array($f['conditions'])) { $this->getValuesDesc($f, $cfg, $others); } // Value is set elseif (array_key_exists('value', $f)) { $desc = [ 'primary' => false, 'type' => null, 'maxlength' => null, 'operator' => $f['operator'] ?? null ]; if (isset($cfg['models'], $f['field'], $cfg['available_fields'][$f['field']])) { $t = $cfg['available_fields'][$f['field']]; if (isset($cfg['models'], $f['field'], $cfg['tables_full'][$t], $cfg['models'][$cfg['tables_full'][$t]]) && ($model = $cfg['models'][$cfg['tables_full'][$t]]) && ($fname = $this->colSimpleName($f['field'])) ) { if (!empty($model['fields'][$fname]['type'])) { $desc = [ 'type' => $model['fields'][$fname]['type'], 'maxlength' => $model['fields'][$fname]['maxlength'] ?? null, 'operator' => $f['operator'] ?? null ]; } // Fixing filters using alias elseif (isset($cfg['fields'][$f['field']]) && ($fname = $this->colSimpleName($cfg['fields'][$f['field']])) && !empty($model['fields'][$fname]['type']) ) { $desc = [ 'type' => $model['fields'][$fname]['type'], 'maxlength' => $model['fields'][$fname]['maxlength'] ?? null, 'operator' => $f['operator'] ?? null ]; } if (!empty($desc['type']) && isset($model['keys']['PRIMARY']) && (count($model['keys']['PRIMARY']['columns']) === 1) && ($model['keys']['PRIMARY']['columns'][0] === $fname) ) { $desc['primary'] = true; } } } $others[] = $desc; } } } return $others; }

BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way

This website uses cookies to ensure you get the best experience on our website.