Skip to content

Commit 648161c

Browse files
authored
refactor: rewrite model (merge MyModel and MyCRUD) (#285)
* refactor: rewrite model - merge: MyModel and MyCRUD * refator: remove final * test: add base test case for database testing * test: add TDD * feat: add `Model:insert` - Tests: 56, Assertions: 7, Skipped: 49 * refactor: constructor parameter order * feat: add `Model::firstColumn` - Tests: 56, Assertions: 13, Skipped: 45. * refactor: use where condition in `hasOne` `hasMany` - Tests: 56, Assertions: 17, Skipped: 42 * refactor: `Model::getter` get from first column - Tests: 56, Assertions: 22, Skipped: 37 * feat: Model support array access - Tests: 58, Assertions: 30, Skipped: 32 * feat: add `Model::find`, `Model::where` - add costume where `Query::whereBinds` - Tests: 59, Assertions: 33, Skipped: 30 * refactor: use `Where::class` to indenty * refactor: normalize `Select::class` * formatting: fix phpstan type * refactor: `Collection` model child (indentifer) * feat: add `Model::equal` find using equal - Tests: 60, Assertions: 34, Skipped: 30 * fix: miss `===` in Bitwise Operators * test: multy rows model test - Tests: 67, Assertions: 66, Skipped: 11 * refactor, feat: upstream update and delete - `Collection` upstream update and delete - add `Model::getPrimeryKey()`, `Model::isExist()`, `Model::findOrCreate` - change visibility `Model::$where` to be `protected` - 68 tests, 95 assertions * refactor: rename class * formatting: phpstan * feat: add costume sort order, limit and offset - 71 tests, 98 assertions) * doc: give every method commen * refactor: remove generic type for `Model` * refactor: support string-class model in `hasOne` and `hasMany` * doc: change doc
1 parent 027cfd2 commit 648161c

12 files changed

+2626
-4
lines changed

composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
},
3838
"autoload-dev": {
3939
"files": [
40+
"tests/DataBase/BaseConnection.php",
4041
"tests/DataBase/QueryStringTest.php",
4142
"tests/DataBase/RealDatabaseConnectionTest.php"
4243
]

0 commit comments

Comments
 (0)