1 <?php
2
3 /* --------------------------------------------------------------
4 ProductAddonValueStorage.inc.php 2016-01-18
5 Gambio GmbH
6 http://www.gambio.de
7 Copyright (c) 2016 Gambio GmbH
8 Released under the GNU General Public License (Version 2)
9 [http://www.gnu.org/licenses/gpl-2.0.html]
10 --------------------------------------------------------------
11 */
12
13 MainFactory::load_class('AbstractAddonValueStorage');
14
15 /**
16 * Class ProductAddonValueStorage
17 *
18 * @category System
19 * @package Product
20 * @subpackage Storages
21 */
22 class ProductAddonValueStorage extends AbstractAddonValueStorage
23 {
24 /**
25 * Get Container Type
26 *
27 * Returns the container class type.
28 *
29 * @return string
30 */
31 protected function _getContainerType()
32 {
33 return 'ProductInterface';
34 }
35
36
37 /**
38 * Get External Fields Array
39 *
40 * Returns a multidimensional array with the primary key of the products_item_codes table
41 * and the required column names with the corresponding key used in the KeyValueCollection.
42 *
43 * @return array
44 */
45 protected function _getExternalFieldsArray()
46 {
47 $externalFields = array();
48
49 // Product item codes.
50 $externalFields['products_item_codes']['primary_key'] = 'products_id';
51 $externalFields['products_item_codes']['fields'] = array(
52 'code_isbn' => 'codeIsbn',
53 'code_upc' => 'codeUpc',
54 'code_mpn' => 'codeMpn',
55 'code_jan' => 'codeJan',
56 'google_export_condition' => 'googleExportCondition',
57 'google_export_availability_id' => 'googleExportAvailabilityId',
58 'brand_name' => 'brandName',
59 'identifier_exists' => 'identifierExists',
60 'gender' => 'gender',
61 'age_group' => 'ageGroup',
62 'expiration_date' => 'expirationDate',
63 );
64
65 // Product primary image dimensions.
66 $externalFields['products']['primary_key'] = 'products_id';
67 $externalFields['products']['fields'] = array(
68 'products_image_w' => 'productsImageWidth',
69 'products_image_h' => 'productsImageHeight',
70 );
71
72 return $externalFields;
73 }
74 }