protected function parseKey($key, $and = true, $noCondition = false, $noTable = false)
{
$keys = explode('-', $key);
$table = strtolower(array_shift($keys));
$len = count($keys);
$condition = [];
for ($i = 0; $i < $len; $i += 2) {
$val = is_numeric($keys[$i + 1]) ? intval($keys[$i + 1]) : $keys[$i + 1];
$and ? $condition[$keys[$i]] = $val : ($condition['$or'][][$keys[$i]] = $val);
}
if (empty($table) && !$noTable) {
throw new \InvalidArgumentException(Lang::get('_DB_PARAM_ERROR_PARSE_KEY_', $key, 'table'));
}
if (empty($condition) && !$noCondition) {
throw new \InvalidArgumentException(Lang::get('_DB_PARAM_ERROR_PARSE_KEY_', $key, 'condition'));
}
return [$table, $condition];
}