mirror of
https://github.com/danog/AsyncOrm.git
synced 2024-11-26 12:24:59 +01:00
Add basic README
This commit is contained in:
parent
bca7169b3e
commit
b6a82d17ce
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
tests/ export-ignore
|
||||||
|
.vscode/ export-ignore
|
7
README.md
Normal file
7
README.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# Async ORM
|
||||||
|
|
||||||
|
Async ORM based on amphp.
|
||||||
|
|
||||||
|
Supports MySQL, Redis, Postgres.
|
||||||
|
|
||||||
|
Features read and write-back caching, type-specific optimizations, and much more!
|
32
tests/TestObject.php
Normal file
32
tests/TestObject.php
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace danog\AsyncOrm\Test;
|
||||||
|
|
||||||
|
use danog\AsyncOrm\DbObject;
|
||||||
|
|
||||||
|
final class TestObject extends DbObject
|
||||||
|
{
|
||||||
|
public int $loadedCnt = 0;
|
||||||
|
public int $saveAfterCnt = 0;
|
||||||
|
public int $saveBeforeCnt = 0;
|
||||||
|
|
||||||
|
public mixed $savedProp = null;
|
||||||
|
|
||||||
|
public function __sleep()
|
||||||
|
{
|
||||||
|
return ['savedProp'];
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function onLoaded(): void
|
||||||
|
{
|
||||||
|
$this->loadedCnt++;
|
||||||
|
}
|
||||||
|
protected function onAfterSave(): void
|
||||||
|
{
|
||||||
|
$this->saveAfterCnt++;
|
||||||
|
}
|
||||||
|
protected function onBeforeSave(): void
|
||||||
|
{
|
||||||
|
$this->saveBeforeCnt++;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user