Skip to content

Commit 6f188db

Browse files
committed
WIP
1 parent 758ac2c commit 6f188db

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

src/CachedBuilder.php

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,11 @@ protected function getWhereClauses(array $wheres = []) : string
9494
}
9595

9696
$value = array_get($where, 'value');
97-
$value .= in_array($where['type'], ['In', 'Null', 'NotNull'])
98-
? strtolower($where['type'])
99-
: '';
100-
$value .= is_array(array_get($where, 'values'))
101-
? '_' . implode('_', $where['values'])
102-
: '';
97+
$value .= $this->getTypeClause($where);
98+
$value .= $this->getValuesClause($where);
10399

104100
return "{$carry}-{$where['column']}_{$value}";
105-
}) ?: '';
101+
}) . '';
106102
}
107103

108104
protected function getWithModels() : string
@@ -246,4 +242,18 @@ public function sum($column)
246242
return parent::sum($column);
247243
});
248244
}
245+
246+
protected function getTypeClause($where)
247+
{
248+
return in_array($where['type'], ['In', 'Null', 'NotNull'])
249+
? strtolower($where['type'])
250+
: '';
251+
}
252+
253+
protected function getValuesClause($where)
254+
{
255+
return is_array(array_get($where, 'values'))
256+
? '_' . implode('_', $where['values'])
257+
: '';
258+
}
249259
}

0 commit comments

Comments
 (0)