%PDF- %PDF-
| Direktori : /home/bitrix/www/bitrix/modules/main/lib/orm/fields/ |
| Current File : /home/bitrix/www/bitrix/modules/main/lib/orm/fields/integerfield.php |
<?php
/**
* Bitrix Framework
* @package bitrix
* @subpackage main
* @copyright 2001-2012 Bitrix
*/
namespace Bitrix\Main\ORM\Fields;
/**
* Entity field class for integer data type
* @package bitrix
* @subpackage main
*/
class IntegerField extends ScalarField
{
/**
* @param mixed $value
*
* @return int
*/
public function cast($value)
{
return (int) $value;
}
/**
* @param mixed $value
*
* @return int
* @throws \Bitrix\Main\SystemException
*/
public function convertValueFromDb($value)
{
return $this->getConnection()->getSqlHelper()->convertFromDbInteger($value);
}
/**
* @param int $value
*
* @return string
* @throws \Bitrix\Main\SystemException
*/
public function convertValueToDb($value)
{
return $this->getConnection()->getSqlHelper()->convertToDbInteger($value);
}
}