/**
  * Create an {@link OptionSetField} and {@link NumericField}.
  * 
  * @param String $name
  * @param String $title
  * @param String $value
  * @param Product|Variation $object Object this stock level is for
  * @param String $maxLength
  * @param String $form
  */
 function __construct($name, $title = null, $value = "", $object, $maxLength = null, $form = null)
 {
     $quantity = $object->getUnprocessedQuantity();
     $cartQuantity = $quantity['InCarts'];
     $orderQuantity = $quantity['InOrders'];
     $label = sprintf(_t('StockField', 'Stock : %s are currently in shopping carts, %s in orders that have not been dispatched.'), $cartQuantity, $orderQuantity);
     $stockChoiceField = new OptionsetField('StockChoice', $label, array(0 => _t('StockField.UNLIMITED', "Unlimited"), 1 => _t('StockField.SPECIFYSTOCK', "Specify Stock")));
     $this->stockChoiceField = $stockChoiceField;
     $stockField = new NumericField('Stock', '', $value, $maxLength, $form);
     $this->stockLevelField = $stockField;
     parent::__construct($name, $title, $value, $form);
 }