PHP
To define PHP as the target language in a template file :
#set( $env.language = 'PHP' )
A "?" is automatically added at the beginning of the type if the attribute is "nullable" (no "@NotNull" annotation). To disable this behavior:
#set( $env.typeWithNullableMark = false )
The information below shows the behavior of the generator when PHP is the current target language. For a detailed description of type conversion, see the generated documentation :
https://www.telosys.org/doc/latest/languages/language-php.html
So since Telosys version 4.1.0, type conversion was added for the PHP language.
Model type | PHP property type | with annotation |
---|---|---|
string | ?string string | @NotNull |
byte | ?int
int | @NotNull |
short | ?int
int |
@NotNull |
int | ?int
int |
@NotNull |
long | ?int
int | @NotNull |
decimal | ?float
float | @NotNull |
float | ?float
float | @NotNull |
double | ?float
float | @NotNull |
boolean | ?bool
bool | @NotNull |
date | ?DateTime
DateTime |
@NotNull |
time | ?DateTime
DateTime |
@NotNull |
timestamp | ?DateTime
DateTime |
@NotNull |
binary | |
PHP literal | |
---|---|
TRUE | true |
FALSE | false |
NULL | null |
Last modified 3d ago