/**
  * Create a new nullable field
  * @param $valueField
  * @return NullableField
  */
 function __construct(FormField $valueField, $isNullLabel = null)
 {
     $this->valueField = $valueField;
     $this->isNullLabel = $isNullLabel;
     if (is_null($this->isNullLabel)) {
         // Set a default label if one is not provided.
         $this->isNullLabel = _t('NullableField.IsNullLabel', 'Is Null');
     }
     parent::__construct($valueField->getName(), $valueField->Title(), $valueField->Value(), $valueField->getForm(), $valueField->RightTitle());
     $this->readonly = $valueField->isReadonly();
 }
示例#2
0
 /**
  * Create a new nullable field
  *
  * @param FormField $valueField
  * @param null|string $isNullLabel
  */
 public function __construct(FormField $valueField, $isNullLabel = null)
 {
     $this->valueField = $valueField;
     if (isset($isNullLabel)) {
         $this->setIsNullLabel($isNullLabel);
     } else {
         $this->isNullLabel = _t('NullableField.IsNullLabel', 'Is Null');
     }
     parent::__construct($valueField->getName(), $valueField->Title(), $valueField->Value());
     $this->setForm($valueField->getForm());
     $this->setRightTitle($valueField->RightTitle());
     $this->setReadonly($valueField->isReadonly());
 }