uawdijnntqw1x1x1
IP : 216.73.216.74
Hostname : www.vorobey-market.ru
Kernel : Linux www.vorobey-market.ru 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
home
/
bitrix
/
vorobey-clubru
/
bitrix
/
modules
/
main
/
lib
/
entity
/
booleanfield.php
/
/
<?php /** * Bitrix Framework * @package bitrix * @subpackage main * @copyright 2001-2012 Bitrix */ namespace Bitrix\Main\Entity; /** * Entity field class for boolean data type * @package bitrix * @subpackage main */ class BooleanField extends ScalarField { /** * Value (false, true) equivalent map * @var array */ protected $values; function __construct($name, $parameters = array()) { parent::__construct($name, $parameters); if (empty($parameters['values'])) { $this->values = array(false, true); } else { $this->values = $parameters['values']; } } /** * Convert true/false values to actual field values * @param boolean|integer|string $value * @return mixed */ public function normalizeValue($value) { if ( (is_string($value) && ($value == '1' || $value == '0')) || (is_bool($value)) ) { $value = (int) $value; } elseif (is_string($value) && $value == 'true') { $value = 1; } elseif (is_string($value) && $value == 'false') { $value = 0; } if (is_integer($value) && ($value == 1 || $value == 0)) { $value = $this->values[$value]; } return $value; } public function getValidators() { $validators = parent::getValidators(); if ($this->validation === null) { $validators[] = new Validator\Enum; } return $validators; } public function getValues() { return $this->values; } public function isValueEmpty($value) { return (strval($value) === '' && $value !== false); } }
/home/bitrix/vorobey-clubru/bitrix/modules/main/lib/entity/booleanfield.php