コード例 #1
0
ファイル: Product.php プロジェクト: njaeger/magento_github
 protected function _validate()
 {
     $_validationResult = parent::_validate();
     if (!$_validationResult) {
         return false;
     }
     $attributesFlag = false;
     if ($attributes = $this->getAttributes()) {
         $attributesCount = 0;
         foreach ($attributes as $_attributeId => $_attributeValue) {
             if ($_attributeValue != '') {
                 $attributesCount++;
             }
         }
         if ($attributesCount && $attributesCount <= self::DEFAULT_COUNT_OF_ATTRIBUTES) {
             $attributesFlag = true;
         }
     }
     if ($this->_validateEntryFlag && !$attributesFlag) {
         return false;
     }
     if (!$this->_validateEntryFlag && $attributesFlag) {
         return false;
     }
     return true;
 }
コード例 #2
0
ファイル: Page.php プロジェクト: njaeger/magento_github
 protected function _validate()
 {
     if ($this->getPageType() && $this->getPageType() == self::PAGE_TYPE_VARIANT) {
         if ($this->getTrackingScript()) {
             return true;
         }
     }
     return parent::_validate();
 }