Download the PHP package fyre/typeparser without Composer
On this page you can find all versions of the php package fyre/typeparser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package typeparser
FyreTypeParser
FyreTypeParser is a free, open-source database type parser library for PHP.
Table Of Contents
- Installation
- Methods
- Types
Installation
Using Composer
In PHP:
Methods
Clear
Clear all loaded types.
Get Type
Get the mapped Type class for a value type.
$type
is a string representing the value type.
Get Type Map
Get the type class map.
Map Type
Map a value type to a class.
$type
is a string representing the value type.$typeClass
is a string representing the class name.
Use
Load a shared Type instance for a value type.
$type
is a string representing the value type.
Types
You can load a specific type parser by specifying the $type
argument of the use
method above.
Custom type parsers can be created by extending \Fyre\DB\Types\Type
, ensuring all below methods are implemented.
From Database
Parse a database value to PHP value.
$value
is the value to parse.
Parse
Parse a user value to PHP value.
$value
is the value to parse.
To Database
Parse a PHP value to database value.
$value
is the value to parse.
Binary
Boolean
Date
Get Locale Format
Get the locale format.
Set Locale Format
Set the locale format.
$format
is a string representing the locale format.
DateTime
Get Locale Format
Get the locale format.
Get Server Time Zone
Get the server time zone.
Get User Time Zone
Get the user time zone.
Set Locale Format
Set the locale format.
$format
is a string representing the locale format, or a Closure that returns the locale format.
Set Server Time Zone
Get the server time zone.
$timeZone
is a string representing the time zone name.
Set User Time Zone
Get the user time zone.
$timeZone
is a string representing the time zone name, or a Closure that returns the time zone name.
DateTime (Fractional)
Get Locale Format
Get the locale format.
Get Server Time Zone
Get the server time zone.
Get User Time Zone
Get the user time zone.
Set Locale Format
Set the locale format.
$format
is a string representing the locale format.
Set Server Time Zone
Get the server time zone.
$timeZone
is a string representing the time zone name.
Set User Time Zone
Get the user time zone.
$timeZone
is a string representing the time zone name.
DateTime (Time Zone)
Get Locale Format
Get the locale format.
Get Server Time Zone
Get the server time zone.
Get User Time Zone
Get the user time zone.
Set Locale Format
Set the locale format.
$format
is a string representing the locale format.
Set Server Time Zone
Get the server time zone.
$timeZone
is a string representing the time zone name.
Set User Time Zone
Get the user time zone.
$timeZone
is a string representing the time zone name.
Decimal
Enum
Float
Integer
Json
Set Encoding Flags
Set the encoding flags.
$flags
is a number representing the encoding flags.
Set
String
Text
Time
Get Locale Format
Get the locale format.
Set Locale Format
Set the locale format.
$format
is a string representing the locale format.