@@ -518,7 +518,7 @@ public function validate(\Magento\Framework\Model\AbstractModel $model)
518
518
$ attrCode = $ this ->getAttribute ();
519
519
520
520
if ('category_ids ' == $ attrCode ) {
521
- return $ this ->validateAttribute ($ this ->getAvailableInCategories ($ model ));
521
+ return $ this ->validateAttribute ($ model ->getAvailableInCategories ($ model ));
522
522
} elseif (!isset ($ this ->_entityAttributeValues [$ model ->getId ()])) {
523
523
if (!$ model ->getResource ()) {
524
524
return false ;
@@ -621,7 +621,7 @@ public function getMappedSqlField()
621
621
public function validateByEntityId ($ productId )
622
622
{
623
623
if ('category_ids ' == $ this ->getAttribute ()) {
624
- $ result = $ this ->validateAttribute ($ this ->_getAvailableInCategoriesById ($ productId ));
624
+ $ result = $ this ->validateAttribute ($ this ->_getAvailableInCategories ($ productId ));
625
625
} elseif ('attribute_set_id ' == $ this ->getAttribute ()) {
626
626
$ result = $ this ->validateAttribute ($ this ->_getAttributeSetId ($ productId ));
627
627
} else {
@@ -632,24 +632,13 @@ public function validateByEntityId($productId)
632
632
return $ result ;
633
633
}
634
634
635
- /**
636
- * Retrieve category ids where product is available
637
- *
638
- * @param \Magento\Framework\Model\AbstractModel $model
639
- * @return array
640
- */
641
- protected function getAvailableInCategories ($ model )
642
- {
643
- return $ model ->getAvailableInCategories ();
644
- }
645
-
646
635
/**
647
636
* Retrieve category ids where productId is available
648
637
*
649
638
* @param int $productId
650
639
* @return array
651
640
*/
652
- protected function _getAvailableInCategoriesById ($ productId )
641
+ protected function _getAvailableInCategories ($ productId )
653
642
{
654
643
return $ this ->_productResource ->getConnection ()
655
644
->fetchCol (
0 commit comments