add integer format
This commit is contained in:
@ -4,6 +4,7 @@ namespace Itguild\Tables;
|
||||
|
||||
use Itguild\Tables\formats\DateFormat;
|
||||
use Itguild\Tables\formats\HtmlFormat;
|
||||
use Itguild\Tables\formats\IntegerFormat;
|
||||
use Itguild\Tables\formats\PhoneNumberFormat;
|
||||
use Itguild\Tables\formats\TextFormat;
|
||||
|
||||
@ -17,6 +18,7 @@ class FormatMapper
|
||||
'date' => DateFormat::class,
|
||||
'html' => HtmlFormat::class,
|
||||
'phoneNumber' => PhoneNumberFormat::class,
|
||||
'integer' => IntegerFormat::class,
|
||||
];
|
||||
}
|
||||
|
||||
|
14
src/formats/IntegerFormat.php
Normal file
14
src/formats/IntegerFormat.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Itguild\Tables\formats;
|
||||
|
||||
use Itguild\Tables\formats\BaseFormat;
|
||||
|
||||
class IntegerFormat extends BaseFormat
|
||||
{
|
||||
|
||||
static function fetch(?string $data, string $options = "")
|
||||
{
|
||||
return intval($data);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user