1 | <?php |
||
9 | abstract class ModelBuilder implements ModelBuilderInterface |
||
10 | { |
||
11 | const BUILD_FOR_CREATE = 'create'; |
||
12 | const BUILD_FOR_UPDATE = 'update'; |
||
13 | const BUILD_FOR_PATCH = 'patch'; |
||
14 | |||
15 | protected $params = []; |
||
16 | |||
17 | 15 | public function build($buildType = self::BUILD_FOR_CREATE) |
|
23 | |||
24 | /** |
||
25 | * Defined the required fields for the given build type. |
||
26 | * |
||
27 | * @param string $buildType |
||
28 | * |
||
29 | * @return array |
||
30 | */ |
||
31 | abstract protected function getRequiredFields($buildType = self::BUILD_FOR_CREATE); |
||
32 | |||
33 | /** |
||
34 | * Validate the parameters. |
||
35 | * |
||
36 | * @param string $buildType the build type to validate the parameters |
||
37 | */ |
||
38 | 15 | protected function validate($buildType = self::BUILD_FOR_CREATE) |
|
51 | } |
||
52 |