Example #1
0
 /**
  * Create singleton version of particular type of form field.
  *
  * @overwritten
  * @access   public
  * @param    string $sType
  * @return   Form\Field
  * @since    1.0.0-alpha
  * @version  1.0.0-alpha
  */
 public function cloneToOtherType($sType)
 {
     $oField = parent::cloneToOtherType($sType);
     /* @var $oField Select */
     $aOptions = [];
     switch ($sType) {
         case 'select':
             foreach ($this->getOptions() as $aOption) {
                 $aOptions[$aOption['value']] = $aOption['label'];
             }
             $oField->setOptions($aOptions);
             break;
     }
     return $oField;
 }