1 <?php
2
3 /* --------------------------------------------------------------
4 CategoryAddonValueStorage.inc.php 2016-01-14
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 /**
14 * Class CategoryAddonValueStorage
15 *
16 * This class extends AbstractAddonValueStorage and handles the association of key-value pairs inside the
17 * CategoryAddonValueStorage to the columns and tables inside the database.
18 * All addon values except these you have registered in the Method '_getExternalFieldsArray' will be stored in the
19 * 'addon_values_storage' table associated with the AddonValueContainerId (category ID).
20 *
21 * @category System
22 * @package Category
23 * @subpackage Storages
24 */
25 class CategoryAddonValueStorage extends AbstractAddonValueStorage
26 {
27 /**
28 * Get the container class type.
29 *
30 * @return string
31 */
32 protected function _getContainerType()
33 {
34 return 'CategoryInterface';
35 }
36
37
38 /**
39 * This method is for registering the addon values which are not stored inside the 'addon_values_storage' table.
40 *
41 * The returning array must be multidimensional and contains a set of database tables with corresponding primary
42 * keys and the fields which are not stored in the addon_values_storage table.
43 *
44 * Example:
45 * $externalFields = array();
46 *
47 * // Icon height and width.
48 * $externalFields['categories']['primary_key'] = 'categories_id';
49 * $externalFields['categories']['fields'] = array(
50 * 'categories_icon_w' => 'iconWidth',
51 * 'categories_icon_h' => 'iconHeight'
52 * );
53 *
54 * // Other categories related data
55 * $externalFields['table_name']['primary_key'] = 'categories_id';
56 * $externalFields['table_name']['fields'] = array(
57 * 'column_name1' => 'addonValueKey1',
58 * 'column_name2' => 'addonValueKey2',
59 * );
60 *
61 * return $externalFields;
62 *
63 * @return array
64 */
65 protected function _getExternalFieldsArray()
66 {
67 return array();
68 }
69 }