Shorter more expressive syntax
Pre-release
Pre-release
The introduction of the concept of a QueryCollection meant that longhand API usage was too wordy and had too many steps to perform simple operations.
This release includes a new shorter syntax and due to this syntax being preferred, dropping accessing QueryCollection via ArrayAccess (backwards breaking).
New syntax:
$db = new Client();
$customer = $db->fetch("customer/getById", ["id" => 123]);
$customerList = $db->fetchAll("customer/getInTown", ["town" => "London"]);
$newCustomerId = $db->insert("customer/create", $details);
$updatedCount = $db->update("customer/setDetails", $details);
$deletedCount = $db->delete("customer/deleteOlderThan", ["createdAt" =>new DateTime("-30 days")]);