1 | <?php |
||
25 | class AttributeType extends BaseAttributeType |
||
26 | { |
||
27 | /** |
||
28 | * Returns a value based on the slug, attribute_av_id and locale |
||
29 | * |
||
30 | * <code> |
||
31 | * $value = AttributeType::getValue('color', 2); |
||
32 | * </code> |
||
33 | * |
||
34 | * @param string $slug |
||
35 | * @param int $attributeAvId |
||
36 | * @param string $locale |
||
37 | * @return string |
||
38 | * @throws \Propel\Runtime\Exception\PropelException |
||
39 | */ |
||
40 | public static function getValue($slug, $attributeAvId, $locale = 'en_US') |
||
44 | |||
45 | /** |
||
46 | * Returns a set of values |
||
47 | * If the value does not exist, it is replaced by null |
||
48 | * |
||
49 | * <code> |
||
50 | * $values = AttributeType::getValue(['color','texture'], [4,7]); |
||
51 | * </code> |
||
52 | * |
||
53 | * <sample> |
||
54 | * array( |
||
55 | * 'color' => [4 => '#00000', 7 => '#FFF000'], |
||
56 | * 'texture' => [4 => null, 7 => 'lines.jpg'] |
||
57 | * ) |
||
58 | * </sample> |
||
59 | * |
||
60 | * @param string[] $slugs |
||
61 | * @param int[] $attributeAvIds |
||
62 | * @param string $locale |
||
63 | * @return string |
||
64 | * @throws \Propel\Runtime\Exception\PropelException |
||
65 | */ |
||
66 | public static function getValues(array $slugs, array $attributeAvIds, $locale = 'en_US') |
||
100 | |||
101 | /** |
||
102 | * Returns a set of first values |
||
103 | * If the value does not exist, it is replaced by null |
||
104 | * |
||
105 | * <code> |
||
106 | * $values = AttributeType::getFirstValues(['color','texture','other'], [4,7]); |
||
107 | * </code> |
||
108 | * |
||
109 | * <sample> |
||
110 | * array( |
||
111 | * 'color' => '#00000', |
||
112 | * 'texture' => 'lines.jpg', |
||
113 | * 'other' => null |
||
114 | * ) |
||
115 | * </sample> |
||
116 | * |
||
117 | * @param string[] $slugs |
||
118 | * @param int[] $attributeAvIds |
||
119 | * @param string $locale |
||
120 | * @return array |
||
121 | */ |
||
122 | public static function getFirstValues(array $slugs, array $attributeAvIds, $locale = 'en_US') |
||
144 | |||
145 | /** |
||
146 | * Find AttributeAv by slugs, attributeIds, values, locales |
||
147 | * |
||
148 | * <code> |
||
149 | * $attributeAv = AttributeType::getAttributeAv('color', '1', '#00000'); |
||
150 | * </code> |
||
151 | * |
||
152 | * @param null|string|array $slugs |
||
153 | * @param null|string|array $attributeIds |
||
154 | * @param null|string|array $values meta values |
||
155 | * @param null|string|array $locale |
||
156 | * |
||
157 | * @return \Thelia\Model\AttributeAv |
||
158 | */ |
||
159 | public static function getAttributeAv($slugs = null, $attributeIds = null, $values = null, $locale = 'en_US') |
||
163 | |||
164 | /** |
||
165 | * Find AttributeAvs by slug, attributeId, value, locale |
||
166 | * |
||
167 | * <code> |
||
168 | * $attributeAvs = AttributeType::getAttributeAvs('color', '1', '#00000'); |
||
169 | * </code> |
||
170 | * |
||
171 | * @param null|string|array $slugs |
||
172 | * @param null|string|array $attributeIds |
||
173 | * @param null|string|array $values meta values |
||
174 | * @param null|string|array $locale |
||
175 | * |
||
176 | * @return \Thelia\Model\AttributeAv |
||
177 | */ |
||
178 | public static function getAttributeAvs($slugs = null, $attributeIds = null, $values = null, $locale = 'en_US') |
||
182 | |||
183 | /** |
||
184 | * @param null|string|array $slugs |
||
185 | * @param null|string|array $attributeIds |
||
186 | * @param null|string|array $values meta values |
||
187 | * @param null|string|array $locales |
||
188 | * |
||
189 | * @return AttributeAvQuery |
||
190 | */ |
||
191 | protected static function queryAttributeAvs($slugs = null, $attributeIds = null, $values = null, $locales = null) |
||
242 | |||
243 | /** |
||
244 | * @param array $strings |
||
245 | * @return string |
||
246 | */ |
||
247 | protected static function formatStringsForIn(array $strings) |
||
259 | |||
260 | /** |
||
261 | * @param Criteria $query |
||
262 | */ |
||
263 | protected static function addJoinAttributeTypeAvMeta(Criteria & $query) |
||
280 | |||
281 | /** |
||
282 | * @param Criteria $query |
||
283 | */ |
||
284 | protected static function addJoinAttributeAttributeType(Criteria & $query) |
||
301 | |||
302 | /** |
||
303 | * @param Criteria $query |
||
304 | */ |
||
305 | protected static function addJoinAttributeType(Criteria & $query) |
||
322 | |||
323 | /** |
||
324 | * @param Criteria $query |
||
325 | * @return $this |
||
326 | */ |
||
327 | protected static function addJoinAttributeAv(Criteria & $query) |
||
344 | } |
||
345 |