src/Darya/ORM/Model.php 1 location
|
@@ 66-74 (lines=9) @@
|
| 63 |
|
* @param array $rows |
| 64 |
|
* @return array |
| 65 |
|
*/ |
| 66 |
|
public static function generate(array $rows = array()) { |
| 67 |
|
$instances = array(); |
| 68 |
|
|
| 69 |
|
foreach ($rows as $key => $attributes) { |
| 70 |
|
$instances[$key] = new static($attributes); |
| 71 |
|
} |
| 72 |
|
|
| 73 |
|
return $instances; |
| 74 |
|
} |
| 75 |
|
|
| 76 |
|
/** |
| 77 |
|
* Recursively convert a model to an array. |
src/Darya/ORM/Record.php 1 location
|
@@ 70-79 (lines=10) @@
|
| 67 |
|
* @param array $rows |
| 68 |
|
* @return Record[] |
| 69 |
|
*/ |
| 70 |
|
public static function generate(array $rows = array()) { |
| 71 |
|
$instances = array(); |
| 72 |
|
|
| 73 |
|
foreach ($rows as $key => $attributes) { |
| 74 |
|
$instances[$key] = new static; |
| 75 |
|
$instances[$key]->setMany($attributes); |
| 76 |
|
} |
| 77 |
|
|
| 78 |
|
return $instances; |
| 79 |
|
} |
| 80 |
|
|
| 81 |
|
/** |
| 82 |
|
* Determine whether the given attribute or relation is set on the record. |