We know, that you are looking forward to a CycleORM updates and this fact motivates us working faster and more efficiently.
Here they are!
CycleORM is used to allow otping a column type among the primitive types such as int
, string
, float
, datetime
and callable
, but now you can create typecast handler class, that implements Cycle\ORM\Parser\TypecastInterface
and define it (or array of handlers) as an Entity columns typecast handler.
<?php | |
$variable = 23; | |
[$query, $params] = sql(fn() => <<<SQL | |
SELECT * FROM users WHERE id = ${yield $variable} OR id = ${yield 42} | |
SQL); | |
var_dump($query, $params); | |
// |
Gist посвящён общим изменениям в Cycle ORM 2.0 относительно первой версии.
Разработка ведётся в ветке 2.0.x-dev
, по мере поступления обновлений гист будет дополняться.
В composer.json
установить директиву minimum-stability: "dev"
,
затем выполнить composer require cycle/orm "2.0.x-dev"
.
Рекомендуется также установить "prefer-stable": true
.