| 1 | <?php |
||
| 13 | class EntityFactory |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * 创建多个实体对象 |
||
| 17 | * |
||
| 18 | * @param string $entityClass |
||
| 19 | * @param array $dataArray |
||
| 20 | * |
||
| 21 | * @return array |
||
| 22 | */ |
||
| 23 | public static function createEntities($entityClass, $dataArray) |
||
| 29 | |||
| 30 | /** |
||
| 31 | * 创建实体对象 |
||
| 32 | * |
||
| 33 | * @param string $entityClass |
||
| 34 | * @param array $data |
||
| 35 | * |
||
| 36 | * @return object |
||
| 37 | */ |
||
| 38 | public static function createEntity($entityClass, $data) |
||
| 45 | |||
| 46 | /** |
||
| 47 | * 设置属性参数. |
||
| 48 | * |
||
| 49 | * @param object $entityInstance |
||
| 50 | * @param array $data |
||
| 51 | * |
||
| 52 | * @return object |
||
| 53 | */ |
||
| 54 | protected static function applyProperties($entityInstance, $data) |
||
| 65 | } |
||
| 66 |