protected function validateCombinationStockProduct($index, &$combination)
    {
        if (empty($combination['stock'])) {
            return null;
        }

        if (!is_numeric($combination['stock']) || strlen($combination['stock']) > 10) {
            $error = $this->translation->text('Only numeric values and no longer than @num characters', array('@num' => 10));
            $this->setError("combination.$index.stock", $error);
        }

        return !isset($error);
    }
protected function validateCombinationStockProduct($index, &$combination)
    {
        if (empty($combination['stock'])) {
            return null;
        }

        if (!is_numeric($combination['stock']) || strlen($combination['stock']) > 10) {
            $error = $this->translation->text('Only numeric values and no longer than @num characters', array('@num' => 10));
            $this->setError("combination.$index.stock", $error);
        }

        return !isset($error);
    }
protected function validateCombinationStockProduct ( $ index , & $ combination ) { if ( empty ( $ combination [ 'stock' ] ) ) { return null ; } if ( ! is_numeric ( $ combination [ 'stock' ] ) || strlen ( $ combination [ 'stock' ] ) > 10 ) { $ error = $ this -> translation -> text ( 'Only numeric values and no longer than @num characters' , array ( '@num' => 10 ) ) ; $ this -> setError ( "combination.$index.stock" , $ error ) ; } return ! isset ( $ error ) ; }
Validates combination stock level
@param integer $index
@param array $combination
@return null|boolean
Validates combination stock level