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