|
5 | 5 | DatabaseObject library is a set of classes that make work with database just a bit easier. Here are the key concepts: |
6 | 6 |
|
7 | 7 | 1. Types - entities that map to a single table, |
8 | | -2. Objects - type instances that map to a single row of a type table, |
9 | | -3. Collections - a group of objects that meets the given criteria. This group is perfect for HTTP responses because collections support data tagging and tag validation (ETag and HTTP 304), |
10 | | -4. Pool - manage registered types and make multi-type interaction possible, |
11 | | -6. Producers - customise the way pool produces new instances, |
12 | | -7. Validators - validate object properties before saving them to the database. |
| 8 | +1. Entities - type instances that map to a single row of a type table, |
| 9 | +1. Entity Manager - instances that provide access to custom type specific manipulation methods, |
| 10 | +1. Collections - a group of objects that meets the given criteria. This group is perfect for HTTP responses because collections support data tagging and tag validation (ETag and HTTP 304), |
| 11 | +1. Pool - manage registered types and make multi-type interaction possible, |
| 12 | +1. Producers - customise the way pool produces new instances, |
| 13 | +1. Validators - validate object properties before saving them to the database. |
13 | 14 |
|
14 | 15 | ## CRUD |
15 | 16 |
|
16 | 17 | If you wish to work with entire tables, use CRUD methods provided by `ConnectionInterface`: |
17 | 18 |
|
18 | 19 | 1. `ConnectionInterface::insert()` - insert one or more rows |
19 | | -2. `ConnectionInterface::update()` - update a set of rows that match the given conditions, if any |
20 | | -3. `ConnectionInterface::delete()` - drop a set of rows taht match the given conditions, if any |
| 20 | +1. `ConnectionInterface::update()` - update a set of rows that match the given conditions, if any |
| 21 | +1. `ConnectionInterface::delete()` - drop a set of rows taht match the given conditions, if any |
21 | 22 |
|
22 | 23 | When you need to work with individual instances, `PoolInterface` provides following handy methods: |
23 | 24 |
|
24 | 25 | 1. `PoolInterface::produce()` - create a new record based on the given parameters, |
25 | | -2. `PoolInterface::modify()` - change the given object with a set of parameters, |
26 | | -3. `PoolInterface::scrap()` - trash or permanently delete the given object. |
| 26 | +1. `PoolInterface::modify()` - change the given object with a set of parameters, |
| 27 | +1. `PoolInterface::scrap()` - trash or permanently delete the given object. |
27 | 28 |
|
28 | 29 | ## Scrap |
29 | 30 |
|
|
0 commit comments