本文整理汇总了PHP中DBField::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP DBField::__construct方法的具体用法?PHP DBField::__construct怎么用?PHP DBField::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBField
的用法示例。
在下文中一共展示了DBField::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* 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);
}
示例2: isset
/**
* 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);
}
示例3: array
/**
* 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);
}
示例4: __construct
/**
* 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);
}
示例5: __construct
/**
* 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);
}
示例6: split
/**
* 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);
}
示例7: __construct
public function __construct($name = null)
{
$this->currencyLib = new Zend_Currency(null, i18n::get_locale());
parent::__construct($name);
}
示例8: __construct
public function __construct($name = null, $defaultVal = 0)
{
$this->defaultVal = $defaultVal ? 1 : 0;
parent::__construct($name);
}
示例9: __construct
/**
* DBField contrustor
*
* @param string $name Field name
*/
public function __construct($name = null)
{
$this->defaultVal = '000000100';
parent::__construct($name);
}
示例10: __construct
public function __construct($name = null, $defaultVal = 0)
{
$this->defaultVal = is_float($defaultVal) ? $defaultVal : (double) 0;
parent::__construct($name);
}
示例11:
function __construct($name = null, $srid = null)
{
$this->srid = $srid;
parent::__construct($name);
}
示例12: __construct
public function __construct($name = null)
{
parent::__construct($name);
}
示例13: isset
/**
* 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);
}
示例14:
function __construct($name, $defaultVal = 0) {
$this->defaultVal = is_float($defaultVal) ? $defaultVal : (float) 0;
parent::__construct($name);
}
示例15:
function __construct($name, $size = 50)
{
$this->size = $size ? $size : 50;
parent::__construct($name);
}