| @@ 185-197 (lines=13) @@ | ||
| 182 | * |
|
| 183 | * @return bool |
|
| 184 | */ |
|
| 185 | public function HasProductQuestions() |
|
| 186 | { |
|
| 187 | if (!isset(self::$_has_product_questions[$this->owner->ID])) { |
|
| 188 | $productQuestions = $this->owner->ProductQuestions(); |
|
| 189 | if ($productQuestions && $productQuestions->count()) { |
|
| 190 | self::$_has_product_questions[$this->owner->ID] = true; |
|
| 191 | } else { |
|
| 192 | self::$_has_product_questions[$this->owner->ID] = false; |
|
| 193 | } |
|
| 194 | } |
|
| 195 | ||
| 196 | return self::$_has_product_questions[$this->owner->ID]; |
|
| 197 | } |
|
| 198 | ||
| 199 | /** |
|
| 200 | * cache only! |
|
| @@ 217-228 (lines=12) @@ | ||
| 214 | /** |
|
| 215 | * @return DataList | Null |
|
| 216 | */ |
|
| 217 | public function ProductQuestions() |
|
| 218 | { |
|
| 219 | if (!isset(self::$_product_questions[$this->owner->ID])) { |
|
| 220 | if ($buyable = $this->owner->productQuestionBuyable()) { |
|
| 221 | self::$_product_questions[$this->owner->ID] = $buyable->ApplicableProductQuestions(); |
|
| 222 | } else { |
|
| 223 | self::$_product_questions[$this->owner->ID] = null; |
|
| 224 | } |
|
| 225 | } |
|
| 226 | ||
| 227 | return self::$_product_questions[$this->owner->ID]; |
|
| 228 | } |
|
| 229 | ||
| 230 | /** |
|
| 231 | * cache only! |
|