当前位置: 首页>>代码示例>>PHP>>正文


PHP DBField::__construct方法代码示例

本文整理汇总了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);
 }
开发者ID:ivoba,项目名称:silverstripe-framework,代码行数:15,代码来源:Decimal.php

示例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);
 }
开发者ID:comperio,项目名称:silverstripe-framework,代码行数:10,代码来源:Decimal.php

示例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);
 }
开发者ID:comperio,项目名称:silverstripe-framework,代码行数:13,代码来源:StringField.php

示例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);
 }
开发者ID:jacobbuck,项目名称:silverstripe-framework,代码行数:17,代码来源:DBString.php

示例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);
 }
开发者ID:helpfulrobot,项目名称:silverstripe-content-services,代码行数:16,代码来源:FileContent.php

示例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);
 }
开发者ID:racontemoi,项目名称:shibuichi,代码行数:30,代码来源:Enum.php

示例7: __construct

 public function __construct($name = null)
 {
     $this->currencyLib = new Zend_Currency(null, i18n::get_locale());
     parent::__construct($name);
 }
开发者ID:jbrown40,项目名称:nvweb,代码行数:5,代码来源:Money.php

示例8: __construct

 public function __construct($name = null, $defaultVal = 0)
 {
     $this->defaultVal = $defaultVal ? 1 : 0;
     parent::__construct($name);
 }
开发者ID:ivoba,项目名称:silverstripe-framework,代码行数:5,代码来源:Boolean.php

示例9: __construct

 /**
  * DBField contrustor
  * 
  * @param string $name Field name
  */
 public function __construct($name = null)
 {
     $this->defaultVal = '000000100';
     parent::__construct($name);
 }
开发者ID:helpfulrobot,项目名称:colymba-silverstripe-colorfield,代码行数:10,代码来源:Color.php

示例10: __construct

 public function __construct($name = null, $defaultVal = 0)
 {
     $this->defaultVal = is_float($defaultVal) ? $defaultVal : (double) 0;
     parent::__construct($name);
 }
开发者ID:jakedaleweb,项目名称:AtomCodeChallenge,代码行数:5,代码来源:Float.php

示例11:

 function __construct($name = null, $srid = null)
 {
     $this->srid = $srid;
     parent::__construct($name);
 }
开发者ID:helpfulrobot,项目名称:silverstripe-solr,代码行数:5,代码来源:SolrGeoDBField.php

示例12: __construct

 public function __construct($name = null)
 {
     parent::__construct($name);
 }
开发者ID:jakedaleweb,项目名称:link-field,代码行数:4,代码来源:WTLink.php

示例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);
 }
开发者ID:racontemoi,项目名称:shibuichi,代码行数:9,代码来源:Decimal.php

示例14:

	function __construct($name, $defaultVal = 0) {
		$this->defaultVal = is_float($defaultVal) ? $defaultVal : (float) 0;
		
		parent::__construct($name);
	}
开发者ID:redema,项目名称:sapphire,代码行数:5,代码来源:Float.php

示例15:

 function __construct($name, $size = 50)
 {
     $this->size = $size ? $size : 50;
     parent::__construct($name);
 }
开发者ID:racontemoi,项目名称:shibuichi,代码行数:5,代码来源:Varchar.php


注:本文中的DBField::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。