wwo
small
This commit is contained in:
parent
2f777a3b0d
commit
d40198ab95
1 changed files with 14 additions and 2 deletions
|
@ -3,8 +3,20 @@ namespace AroMVC\Database;
|
||||||
|
|
||||||
class Insertable extends Queryable {
|
class Insertable extends Queryable {
|
||||||
protected $table = null;
|
protected $table = null;
|
||||||
protected $names = [];
|
protected $fields = [];
|
||||||
protected $values = [];
|
|
||||||
|
|
||||||
|
|
||||||
|
public function __construct(string $table) {
|
||||||
|
$this->table = $table;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function value(string $name, $value): Insertable {
|
||||||
|
$fields[$name] = $value;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function values(array $values): Insertable {
|
||||||
|
foreach($values as $name => $value)
|
||||||
|
$fields[$name] = $value;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
Reference in a new issue