1 | <?php |
||
12 | class ContentMapper |
||
13 | { |
||
14 | const FIELD_TITLE = "title"; |
||
15 | const FIELD_SUMMARY = "summary"; |
||
16 | const FIELD_DESCRIPTION = "description"; |
||
17 | |||
18 | /** |
||
19 | * @var array $mandatoryFields A list of all mandatory fields of a Content |
||
20 | */ |
||
21 | private $mandatoryFields = [self::FIELD_TITLE, self::FIELD_SUMMARY]; |
||
22 | |||
23 | /** |
||
24 | * Creates a new ContentMapper instance |
||
25 | */ |
||
26 | 3 | public function __construct() |
|
29 | |||
30 | /** |
||
31 | * Get a Content model from an array of unstructured product content data |
||
32 | * |
||
33 | * @param array $contentData An array containing content attributes |
||
34 | * |
||
35 | * @return Content |
||
36 | * |
||
37 | * @throws ContentException If a mandatory field is missing |
||
38 | * @throws ContentException If the no Content could be created from the given product data |
||
39 | */ |
||
40 | 3 | public function getContent(array $contentData) |
|
78 | } |