27 private $metadataPool;
50 $metadata = $this->getMetadataPool()->getMetadata(ProductInterface::class);
53 $bind = [
'attribute_id' => $object->getAttributeId()];
58 [
'main_table' => $this->resource->getTableName(
'catalog_product_super_attribute')],
59 [
'psa_count' =>
'COUNT(product_super_attribute_id)']
61 [
'entity' => $this->resource->getTableName(
'catalog_product_entity')],
62 'main_table.product_id = entity.' . $metadata->getLinkField()
63 )->where(
'main_table.attribute_id = :attribute_id')
64 ->group(
'main_table.attribute_id')
69 $select->where(
'entity.attribute_set_id = :attribute_set_id');
73 throw new \Magento\Framework\Exception\LocalizedException(
74 __(
'This attribute is used in configurable products.')
83 private function getMetadataPool()
85 if (!$this->metadataPool) {
88 return $this->metadataPool;
validate(\Magento\Framework\Model\AbstractModel $object, $attributeSet=null)
__construct(ResourceConnection $resource)