本文整理汇总了PHP中static::fields方法的典型用法代码示例。如果您正苦于以下问题:PHP static::fields方法的具体用法?PHP static::fields怎么用?PHP static::fields使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类static
的用法示例。
在下文中一共展示了static::fields方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fields
public static function fields($data = array())
{
if (empty($data)) {
return static::$fields;
} else {
return static::$fields = $data;
}
}
示例2: setUp
/**
* @inheritdoc
*/
protected function setUp()
{
static::$Redis->flushall();
static::$fields = ['string' => 'value', 'integer' => 42, 'true' => true, 'false' => false, 'float' => 3.14159265, 'e' => '5.0e3', 'null' => null, '' => 'empty', 'empty' => '', 'bin' => call_user_func_array('pack', ['N*'] + range(0, 255))];
static::$Redis->hmset('hash', static::$fields);
static::$Redis->hmset('', static::$fields);
static::$Redis->set('string', 'value');
}
示例3: __construct
public function __construct()
{
require_once __DIR__ . '/rb.php';
if (!static::$tableName) {
throw new \Exception('未定义表名');
}
static::$tableName = $this->fixTableName();
static::$fields = $this->fixFields();
static::$many2one = $this->fixMany2One();
}
示例4: getInstance
/**
* Get class instance
* @param $neededFields array of fields to set as settings
* @param $neededDepth int depth to set as settings
*/
public static function getInstance($neededFields = null, $neededDepth = null)
{
if (is_null(self::$instance)) {
$childclass = get_called_class();
self::$instance = new $childclass();
}
// Set fields if user ask for it
if (!is_null($neededFields)) {
static::$fields = isset(static::${$neededFields}) ? static::${$neededFields} : [];
}
// Set depth if user ask for it
if (!is_null($neededDepth)) {
static::$depth = $neededDepth;
}
return self::$instance;
}
示例5: getInstance
/**
* Get class instance
* $instances is an array which contains each instanced child class
* @param $neededFields array of fields to set as settings
* @param $neededDepth int depth to set as settings
*/
public static function getInstance($neededFields = null, $neededDepth = null)
{
$childClass = get_called_class();
if (!isset(self::$instances[$childClass])) {
self::$instances[$childClass] = new $childClass();
}
// Set field if user ask for it
if (!is_null($neededFields)) {
if (is_string($neededFields)) {
static::$fields = isset(static::${$neededFields}) ? static::${$neededFields} : [];
} else {
if (is_array($neededFields)) {
static::$fields = $neededFields;
}
}
}
// Set depth if user ask for it
if (!is_null($neededDepth)) {
static::$depth = $neededDepth;
}
return self::$instances[$childClass];
}
示例6:
function __construct($fields = [])
{
static::$fields = [['content', 'Содержание', 0, 'string', 'widget' => ['cs\\Widget\\HtmlContent\\HtmlContent', []]], ['subject', 'Тема письма', 1, 'string']];
parent::__construct($fields);
}
示例7:
function __construct($fields = [])
{
static::$fields = [['content', 'Название', 1, 'string']];
parent::__construct($fields);
}
示例8: jsonSerialize
public function jsonSerialize()
{
if (!static::$fields) {
static::$fields = new Map();
}
return static::$fields->jsonSerialize();
}
示例9:
function __construct($fields = [])
{
static::$fields = [['name_first', 'Имя', 0, 'string'], ['name_last', 'Фамилия', 0, 'string'], ['name_middle', 'Отчество', 0, 'string'], ['content', 'Описание', 0, 'string', 'widget' => ['cs\\Widget\\HtmlContent\\HtmlContent', []]], ['description', 'Описание краткое', 0, 'string'], ['image', 'Картинка', 0, 'string', 'widget' => [FileUpload::className(), ['options' => ['small' => \app\services\GsssHtml::$formatIcon]]]], ['date_born', 'Дата прихода', 0, 'cs\\Widget\\DatePicker\\Validator', 'widget' => ['cs\\Widget\\DatePicker\\DatePicker', []]], ['date_death', 'Дата ухода', 0, 'cs\\Widget\\DatePicker\\Validator', 'widget' => ['cs\\Widget\\DatePicker\\DatePicker', []]]];
parent::__construct($fields);
}
示例10:
function __construct($fields = [])
{
static::$fields = [['header', 'Название', 1, 'string'], ['description', 'Описание краткое', 0, 'string'], ['content', 'Полное описание', 0, 'string', 'widget' => ['cs\\Widget\\HtmlContent\\HtmlContent', []]], ['parent_id', 'Родительская ветка', 0, 'integer'], ['image', 'Картинка', 0, 'string', 'widget' => [FileUpload::className(), ['options' => ['small' => \app\services\GsssHtml::$formatIcon]]]]];
parent::__construct($fields);
}
示例11:
function __construct($fields = [])
{
static::$fields = [['content', 'Содержание', 0, 'string'], ['subject', 'Тема письма', 1, 'string']];
parent::__construct($fields);
}
示例12: setFields
/**
* Setter for the model's fields array
*
* @param array $fields
*/
public function setFields($fields)
{
static::$fields = $fields;
return $this;
}
示例13:
function __construct($fields = [])
{
static::$fields = [['isRed', 'Есть красный', 0, 'cs\\Widget\\CheckBox2\\Validator', 'widget' => ['cs\\Widget\\CheckBox2\\CheckBox', []]], ['isBlue', 'Есть синий', 0, 'cs\\Widget\\CheckBox2\\Validator', 'widget' => ['cs\\Widget\\CheckBox2\\CheckBox', []]], ['isGreen', 'Есть курс', 0, 'cs\\Widget\\CheckBox2\\Validator', 'widget' => ['cs\\Widget\\CheckBox2\\CheckBox', []]]];
parent::__construct($fields);
}
示例14:
function __construct($fields = [])
{
static::$fields = [['monthCounter', 'Количество месяцев', 1, 'integer'], ['stockId', 'Котировка', 0, 'string'], ['finam_em', 'Идентификатор котировки', 0, 'integer']];
parent::__construct($fields);
}
示例15:
function __construct($fields = [])
{
static::$fields = [['name', 'Название', 1, 'string'], ['content', 'Описание', 0, 'string', 'widget' => ['cs\\Widget\\HtmlContent\\HtmlContent', []]], ['description', 'Описание краткое', 0, 'string'], ['tickets_counter', 'Кол-во билетов в продукте', 0, 'integer'], ['price', 'Цена', 0, 'integer'], ['image', 'Картинка', 0, 'string', 'widget' => [FileUpload::className(), ['options' => ['small' => \app\services\GsssHtml::$formatIcon]]]]];
parent::__construct($fields);
}