00001 <?php 00002 /**************************************************************************** 00003 * Copyright (C) 2004-2007 by Konstantin V. Arkhipov, Anton E. Lebedevich * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU Lesser General Public License as * 00007 * published by the Free Software Foundation; either version 3 of the * 00008 * License, or (at your option) any later version. * 00009 * * 00010 ****************************************************************************/ 00011 /* $Id: PrimitiveInteger.class.php 4687 2007-12-09 18:57:18Z voxus $ */ 00012 00016 class PrimitiveInteger extends PrimitiveNumber 00017 { 00018 const SIGNED_SMALL_MIN = -32768; 00019 const SIGNED_SMALL_MAX = +32767; 00020 00021 const SIGNED_MIN = -2147483648; 00022 const SIGNED_MAX = +2147483647; 00023 00024 const UNSIGNED_SMALL_MAX = 65535; 00025 const UNSIGNED_MAX = 4294967295; 00026 00027 protected function checkNumber($number) 00028 { 00029 Assert::isInteger($number); 00030 } 00031 00032 protected function castNumber($number) 00033 { 00034 return (int) $number; 00035 } 00036 00037 public function toXsdType() 00038 { 00039 return 'xsd:unsignedShort'; 00040 } 00041 } 00042 ?>