Skip to content

Instantly share code, notes, and snippets.

View roxblnfk's full-sized avatar
🤪

Aleksei Gagarin roxblnfk

🤪
View GitHub Profile
@butschster
butschster / 2021-11-19-en.md
Last active December 3, 2021 16:38
CycleORM news digest

Hello everybody!

We know, that you are looking forward to a CycleORM updates and this fact motivates us working faster and more efficiently.

Here they are!

1. Added support for Entity typecast handlers.

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.

@SerafimArts
SerafimArts / example-1.php
Last active April 17, 2022 10:47
phpwtf-1
<?php
$variable = 23;
[$query, $params] = sql(fn() => <<<SQL
SELECT * FROM users WHERE id = ${yield $variable} OR id = ${yield 42}
SQL);
var_dump($query, $params);
//
@roxblnfk
roxblnfk / !index.md
Last active October 21, 2022 23:18
CYCLE ORM v2 SUMMARY [Ru]

Cycle ORM V2 (dev)

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.