/** * Create a new Decimal field. * * @param string $name * @param int $wholeSize * @param int $decimalSize * @param float $defaultValue */ public function __construct($name = null, $wholeSize = 9, $decimalSize = 2, $defaultValue = 0) { $this->wholeSize = is_int($wholeSize) ? $wholeSize : 9; $this->decimalSize = is_int($decimalSize) ? $decimalSize : 2; $this->defaultValue = number_format((double) $defaultValue, $decimalSize); parent::__construct($name); }
/** * Create a new Decimal field. */ function __construct($name, $wholeSize = 9, $decimalSize = 2, $defaultValue = 0) { $this->wholeSize = isset($wholeSize) ? $wholeSize : 9; $this->decimalSize = isset($decimalSize) ? $decimalSize : 2; $this->defaultValue = $defaultValue; parent::__construct($name); }
/** * Construct a string type field with a set of optional parameters * @param $name string The name of the field * @param $options array An array of options e.g. array('nullifyEmpty'=>false). See {@link StringField::setOptions()} for information on the available options */ function __construct($name = null, $options = array()) { // Workaround: The singleton pattern calls this constructor with true/1 as the second parameter, so we must ignore it if (is_array($options)) { $this->setOptions($options); } parent::__construct($name); }
/** * Construct a string type field with a set of optional parameters. * * @param string $name string The name of the field * @param array $options array An array of options e.g. array('nullifyEmpty'=>false). See * {@link StringField::setOptions()} for information on the available options */ public function __construct($name = null, $options = array()) { if ($options) { if (!is_array($options)) { throw new \InvalidArgumentException("Invalid options {$options}"); } $this->setOptions($options); } parent::__construct($name); }
/** * Construct a string type field with a set of optional parameters * @param $name string The name of the field * @param $options array An array of options e.g. array('nullifyEmpty'=>false). See {@link StringField::setOptions()} for information on the available options */ public function __construct($name = null, $store = null) { if ($store && class_exists($store . 'ContentReader')) { $this->store = $store; } else { if ($store) { throw new Exception("{$store} does not exist; cannot use FileContent field with this type"); } } parent::__construct($name); }
/** * Create a new Enum field. * You should create an enum field like this: * "MyField" => "Enum('Val1, Val2, Val3', 'Val1')" * or: "MyField" => "Enum(Array('Val1', 'Val2', 'Val3'), 'Val1')" * but NOT: "MyField" => "Enum('Val1', 'Val2', 'Val3', 'Val1')" * @param enum: A string containing a comma separated list of options or an array of Vals. * @param default The default option, which is either NULL or one of the items in the enumeration. */ function __construct($name, $enum = NULL, $default = NULL) { if ($enum) { if (!is_array($enum)) { $enum = split(" *, *", trim($enum)); } $this->enum = $enum; // If there's a default, then if ($default) { if (in_array($default, $enum)) { $this->default = $default; } else { user_error("Enum::__construct() The default value does not match any item in the enumeration", E_USER_ERROR); } // By default, set the default value to the first item } else { $this->default = reset($enum); } } parent::__construct($name); }
public function __construct($name = null) { $this->currencyLib = new Zend_Currency(null, i18n::get_locale()); parent::__construct($name); }
public function __construct($name = null, $defaultVal = 0) { $this->defaultVal = $defaultVal ? 1 : 0; parent::__construct($name); }
/** * DBField contrustor * * @param string $name Field name */ public function __construct($name = null) { $this->defaultVal = '000000100'; parent::__construct($name); }
function __construct($name, $defaultVal = 0) { $this->defaultVal = is_int($defaultVal) ? $defaultVal : 0; parent::__construct($name); }
public function __construct($name = null, $defaultVal = 0) { $this->defaultVal = is_float($defaultVal) ? $defaultVal : (double) 0; parent::__construct($name); }
function __construct($name = null, $srid = null) { $this->srid = $srid; parent::__construct($name); }
public function __construct($name = null) { parent::__construct($name); }
/** * Create a new Decimal field. */ function __construct($name, $wholeSize = 9, $decimalSize = 2) { $this->wholeSize = isset($wholeSize) ? $wholeSize : 9; $this->decimalSize = isset($decimalSize) ? $decimalSize : 2; parent::__construct($name); }
function __construct($name, $defaultVal = 0) { $this->defaultVal = is_float($defaultVal) ? $defaultVal : (float) 0; parent::__construct($name); }
function __construct($name, $size = 50) { $this->size = $size ? $size : 50; parent::__construct($name); }