mirror of
https://codeberg.org/vlw/scaffold.git
synced 2025-11-05 06:02:42 +01:00
refactor: replace for() with from() in database Model (#7)
This PR replaces the `vlw\MySQL->for()` with `vlw\MySQL->from()` since for() it's deprecated. Reviewed-on: https://codeberg.org/vlw/scaffold/pulls/7
This commit is contained in:
parent
1940d89352
commit
716891a6f4
1 changed files with 7 additions and 7 deletions
|
|
@ -55,7 +55,7 @@
|
||||||
|
|
||||||
$this->_resolved = true;
|
$this->_resolved = true;
|
||||||
$this->_row = $this->db
|
$this->_row = $this->db
|
||||||
->for($this->table)
|
->from($this->table)
|
||||||
->where($this->where)
|
->where($this->where)
|
||||||
->limit(1)
|
->limit(1)
|
||||||
->select($this->columns)
|
->select($this->columns)
|
||||||
|
|
@ -75,11 +75,11 @@
|
||||||
public bool $isset {
|
public bool $isset {
|
||||||
// Returns bool if row is set or attempts to resolve and set if null
|
// Returns bool if row is set or attempts to resolve and set if null
|
||||||
get => $this->_isset ??= new Database()
|
get => $this->_isset ??= new Database()
|
||||||
->for($this->table)
|
->from($this->table)
|
||||||
->where($this->where)
|
->where($this->where)
|
||||||
->limit(1)
|
->limit(1)
|
||||||
->select()
|
->select()
|
||||||
->num_rows === 1;
|
->num_rows === 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -103,7 +103,7 @@
|
||||||
$this->_row[$key] = $value;
|
$this->_row[$key] = $value;
|
||||||
|
|
||||||
return $this->db
|
return $this->db
|
||||||
->for($this->table)
|
->from($this->table)
|
||||||
->where($this->where)
|
->where($this->where)
|
||||||
->update([$key => $value]);
|
->update([$key => $value]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue