Slide 24
Slide 24 text
class OrderGateway
{
public function insert(Connection $conn)
{
$query = 'INSERT INTO orders (reference, amount, vat,
total, created_at) VALUES (?, ?, ?, ?, ?)';
$data = array(
$this->reference, $this->amount, $this->vat,
$this->total, $this->createdAt->format('Y-m-d H:i:s')
);
$conn->executeQuery($query, $data);
$this->id = $conn->lastInsertId();
}
}