public function CommerceSearchApiAlterProductStatus::supportsIndex in Commerce Search API 7
Check whether this data-alter callback is applicable for a certain index.
Parameters
SearchApiIndex $index: The SearchApiIndex this data alteration callback resides on.
Return value
bool A boolean whether or not this index is supported.
Overrides SearchApiAbstractAlterCallback::supportsIndex
File
- includes/
callback_product_status.inc, line 23 - Products data alteration callback.
Class
- CommerceSearchApiAlterProductStatus
- Data alteration callback that filters out products that aren't published
Code
public function supportsIndex(SearchApiIndex $index) {
$bundles = commerce_product_reference_node_types();
return $index
->getEntityType() == 'node' && !empty($bundles);
}