IniRepository: Fix that method update and delete fail without filter
This commit is contained in:
parent
5212b6bab9
commit
f644860529
|
@ -93,15 +93,12 @@ abstract class IniRepository extends Repository implements Extensible, Updatable
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$query = $this->ds->select();
|
||||||
if ($filter !== null) {
|
if ($filter !== null) {
|
||||||
$filter = $this->requireFilter($target, $filter);
|
$query->addFilter($this->requireFilter($target, $filter));
|
||||||
}
|
}
|
||||||
|
|
||||||
$newSection = null;
|
$newSection = null;
|
||||||
|
|
||||||
$query = $this->ds->select();
|
|
||||||
$query->addFilter($filter);
|
|
||||||
|
|
||||||
foreach ($query as $section => $config) {
|
foreach ($query as $section => $config) {
|
||||||
if ($newSection !== null) {
|
if ($newSection !== null) {
|
||||||
throw new StatementException(
|
throw new StatementException(
|
||||||
|
@ -149,12 +146,10 @@ abstract class IniRepository extends Repository implements Extensible, Updatable
|
||||||
*/
|
*/
|
||||||
public function delete($target, Filter $filter = null)
|
public function delete($target, Filter $filter = null)
|
||||||
{
|
{
|
||||||
if ($filter !== null) {
|
|
||||||
$filter = $this->requireFilter($target, $filter);
|
|
||||||
}
|
|
||||||
|
|
||||||
$query = $this->ds->select();
|
$query = $this->ds->select();
|
||||||
$query->addFilter($filter);
|
if ($filter !== null) {
|
||||||
|
$query->addFilter($this->requireFilter($target, $filter));
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($query as $section => $config) {
|
foreach ($query as $section => $config) {
|
||||||
$this->ds->removeSection($section);
|
$this->ds->removeSection($section);
|
||||||
|
|
Loading…
Reference in New Issue