本文整理汇总了PHP中Mage_Eav_Model_Entity_Attribute_Backend_Abstract::validate方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Eav_Model_Entity_Attribute_Backend_Abstract::validate方法的具体用法?PHP Mage_Eav_Model_Entity_Attribute_Backend_Abstract::validate怎么用?PHP Mage_Eav_Model_Entity_Attribute_Backend_Abstract::validate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Eav_Model_Entity_Attribute_Backend_Abstract
的用法示例。
在下文中一共展示了Mage_Eav_Model_Entity_Attribute_Backend_Abstract::validate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validate
/**
* Validate SKU
*
* @param Mage_Catalog_Model_Product $object
* @throws Mage_Core_Exception
* @return bool
*/
public function validate($object)
{
$helper = Mage::helper('core/string');
if ($helper->strlen($object->getSku()) > self::SKU_MAX_LENGTH) {
Mage::throwException(Mage::helper('catalog')->__('SKU length should be %s characters maximum.', self::SKU_MAX_LENGTH));
}
return parent::validate($object);
}
示例2: validate
public function validate($object)
{
if ($password = $object->getPassword()) {
if ($password == $object->getPasswordConfirm()) {
return true;
}
}
return parent::validate($object);
}
示例3: validate
/**
* Implode data for validation
*
* @param Mage_Catalog_Model_Product $object
* @return bool
*/
public function validate($object)
{
$attributeCode = $this->getAttribute()->getAttributeCode();
$data = $object->getData($attributeCode);
if (is_array($data)) {
$object->setData($attributeCode, implode(',', array_filter($data)));
}
return parent::validate($object);
}
示例4: validate
/**
* Validate object
*
* @param Varien_Object $object
* @throws Mage_Eav_Exception
* @return boolean
*/
public function validate($object)
{
$pattern = '#^(\\d+)?\\-\\d+;(\\d+\\-\\d+;)*\\d+\\-(\\d+)?$#';
$value = $object->getFilterPriceRanges();
if ('' != $value && !preg_match($pattern, $value)) {
$message = "Provided Layered Navigation Price Ranges are incorrect.";
$message = Mage::helper('aurmil_customizepricefilter')->__($message);
Mage::throwException($message);
}
return parent::validate($object);
}
示例5: validate
/**
* Validate process
*
* @param Varien_Object $object
* @return bool
*/
public function validate($object)
{
if (!parent::validate($object)) {
return false;
}
$attributeCode = $this->getAttribute()->getName();
if ($attributeCode == 'default_sort_by') {
if ($available = $object->getData('available_sort_by')) {
if (!is_array($available)) {
$available = explode(',', $available);
}
if (!in_array($object->getData($attributeCode), $available)) {
Mage::throwException(Mage::helper('eav')->__('Default Product Listing Sort by not exists on Available Product Listing Sort by'));
}
}
}
return true;
}