_savePropertyValue(self::PROPERTY_WIDTH_ID, $width); return $this; } public function prepareProperties(&$data) { if ($data['label']) { if ($data['labelPlacement'] == 'top') { $data['totalWidth'] = max($data['width'], $data['labelWidth']) + self::WIDTH_GAP; } else { $data['totalWidth'] = $data['width'] + $data['labelWidth'] + self::WIDTH_GAP; } } else { $data['totalWidth'] = $data['width'] + self::WIDTH_GAP; } $data['propertyName'] = $data['name']; return $this; } public function bindField(Qs_Form $form) { parent::bindField($form); if ('y' === $this->getData('isDecimal')) { $prefix = $this->getData('formType') != App_FormBuilder_Obj::DEFAULT_FORM_TYPE ? $this->getData('formType') : ''; $form->getElement($prefix . $this->getData('name')) ->addValidator('Float') ->addFilter('Callback', array('callback' => array($this, 'roundValue'))); } return $this; } public function roundValue($value) { $validator = new Zend_Validate_Float(); if (!$validator->isValid($value)) { return $value; } return round($value, 4); } }