1 <?php
2 /* --------------------------------------------------------------
3 EnvProductImageFileStorageSettings.inc.php 2016-02-09
4 Gambio GmbH
5 http://www.gambio.de
6 Copyright (c) 2016 Gambio GmbH
7 Released under the GNU General Public License (Version 2)
8 [http://www.gnu.org/licenses/gpl-2.0.html]
9 --------------------------------------------------------------
10 */
11
12 /**
13 * Class EnvProductImageFileStorageSettings
14 *
15 * @category System
16 * @package Product
17 * @subpackage Entities
18 *
19 * @codeCoverageIgnore
20 */
21 class EnvProductImageFileStorageSettings implements ProductImagePathsSettingsInterface
22 {
23
24 /**
25 * Get Product Original Images Dir Path
26 *
27 * Returns a string to the original_images folder.
28 *
29 * @throws UnknownEnvironmentException if the original_images folder was not found.
30 *
31 * @return string The path to the original_images folder.
32 */
33 public function getProductOriginalImagesDirPath()
34 {
35 if(defined('DIR_FS_CATALOG_ORIGINAL_IMAGES'))
36 {
37 return DIR_FS_CATALOG_ORIGINAL_IMAGES;
38 }
39 elseif(defined('DIR_WS_ORIGINAL_IMAGES'))
40 {
41 return DIR_FS_CATALOG . DIR_WS_ORIGINAL_IMAGES;
42 }
43 throw new UnknownEnvironmentException();
44 }
45
46
47 /**
48 * Get Product Gallery Images Dir Path
49 *
50 * Returns a string to the gallery_images folder.
51 *
52 * @throws UnknownEnvironmentException if the gallery_images folder was not found.
53 *
54 * @return string The path to the gallery_images folder.
55 */
56 public function getProductGalleryImagesDirPath()
57 {
58 if(defined('DIR_FS_CATALOG') && defined('DIR_WS_IMAGES'))
59 {
60 return DIR_FS_CATALOG . DIR_WS_IMAGES . 'product_images/gallery_images/';
61 }
62 throw new UnknownEnvironmentException();
63 }
64
65
66 /**
67 * Get Product Info Images Dir Path
68 *
69 * Returns a string to the info_images folder.
70 *
71 * @throws UnknownEnvironmentException if the info_images folder was not found.
72 *
73 * @return string The path to the info_images folder.
74 */
75 public function getProductInfoImagesDirPath()
76 {
77 if(defined('DIR_FS_CATALOG_INFO_IMAGES'))
78 {
79 return DIR_FS_CATALOG_INFO_IMAGES;
80 }
81 elseif(defined('DIR_WS_INFO_IMAGES'))
82 {
83 return DIR_FS_CATALOG . DIR_WS_INFO_IMAGES;
84 }
85 throw new UnknownEnvironmentException();
86 }
87
88
89 /**
90 * Get Product Popup Images Dir Path
91 *
92 * Returns a string to the popup_images folder.
93 *
94 * @throws UnknownEnvironmentException if the popup_images folder was not found.
95 *
96 * @return string The path to the popup_images folder.
97 */
98 public function getProductPopupImagesDirPath()
99 {
100 if(defined('DIR_FS_CATALOG_POPUP_IMAGES'))
101 {
102 return DIR_FS_CATALOG_POPUP_IMAGES;
103 }
104 elseif(defined('DIR_WS_POPUP_IMAGES'))
105 {
106 return DIR_FS_CATALOG . DIR_WS_POPUP_IMAGES;
107 }
108 throw new UnknownEnvironmentException();
109 }
110
111
112 /**
113 * Get Product Thumbnail Images Dir Path
114 *
115 * Returns a string to the thumbnail_images folder.
116 *
117 * @throws UnknownEnvironmentException if the thumbnail_images folder was not found.
118 *
119 * @return string The path to the thumbnail_images folder.
120 */
121 public function getProductThumbnailImagesDirPath()
122 {
123 if(defined('DIR_FS_CATALOG_THUMBNAIL_IMAGES'))
124 {
125 return DIR_FS_CATALOG_THUMBNAIL_IMAGES;
126 }
127 elseif(defined('DIR_WS_THUMBNAIL_IMAGES'))
128 {
129 return DIR_FS_CATALOG . DIR_WS_THUMBNAIL_IMAGES;
130 }
131 throw new UnknownEnvironmentException();
132 }
133 }