@@ -934,7 +934,7 @@ Defines the used primary key of the table. Default is `id` for SQL engine, and *
934
934
** Retrieve first object that satisfies criteria**
935
935
936
936
``` php
937
- Cortex load([ array $filter = NULL [, array $options = NULL [, int $ttl = 0 ]]])
937
+ bool load([ array $filter = NULL [, array $options = NULL [, int $ttl = 0 ]]])
938
938
```
939
939
940
940
Simple sample to load a user:
@@ -950,7 +950,7 @@ if (!$user->dry()) {
950
950
```
951
951
952
952
When called without any parameter, it loads the first record from the database.
953
-
953
+ The method returns ` TRUE ` if the load action was successful.
954
954
955
955
### loaded
956
956
** Count records that are currently loaded**
@@ -1199,6 +1199,15 @@ $news->copyfrom('POST',function($fields) {
1199
1199
null copyto( string $key [, array|string $relDepth = 0 ])
1200
1200
```
1201
1201
1202
+ ### copyto_flat
1203
+ ** Copy mapper values to hive key with relations being simple arrays of keys**
1204
+
1205
+ ``` php
1206
+ null copyto_flat( string $key )
1207
+ ```
1208
+
1209
+ All ` has-many ` relations are being returned as simple array lists of their primary keys.
1210
+
1202
1211
1203
1212
### count
1204
1213
** Count records that match criteria**
@@ -1239,6 +1248,16 @@ string dbtype()
1239
1248
1240
1249
The type is ` SQL ` , ` Mongo ` or ` Jig ` .
1241
1250
1251
+
1252
+ ### defaults
1253
+ ** Return default values from schema configuration**
1254
+
1255
+ ``` php
1256
+ array defaults([ bool $set = FALSE ])
1257
+ ```
1258
+
1259
+ Returns a ` $key ` => ` $value ` array of fields that has a default value different than ` NULL ` .
1260
+
1242
1261
### dry
1243
1262
** Return TRUE if current cursor position is not mapped to any record**
1244
1263
@@ -1472,6 +1491,14 @@ null reset([ bool $mapper = true ])
1472
1491
1473
1492
If ` $mapper ` is * false* , it only reset filter, default values and internal caches of the mapper, but leaves the hydrates record untouched.
1474
1493
1494
+ ### resetFields
1495
+ ** reset only specific fields and return to their default values**
1496
+
1497
+ ``` php
1498
+ null resetFields( array $fields )
1499
+ ```
1500
+
1501
+ If any field doesn't have a default value, it's reset to ` NULL ` .
1475
1502
1476
1503
### resolveConfiguration
1477
1504
** kick start mapper to fetch its config**
0 commit comments