Download the PHP package marekskopal/orm-decimal without Composer
On this page you can find all versions of the php package marekskopal/orm-decimal. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download marekskopal/orm-decimal
More information about marekskopal/orm-decimal
Files in marekskopal/orm-decimal
Package orm-decimal
Short Description Decimal type from ext-decimal PHP extension mapper for MarekSkopal ORM.
License MIT
Informations about the package orm-decimal
ORM Decimal
Decimal\Decimal type mapper for marekskopal/orm, powered by the ext-decimal PHP extension. Handles precise decimal arithmetic without floating-point rounding errors — ideal for monetary values and other exact numeric data.
Requirements
- PHP >= 8.4
ext-decimalPHP extensionmarekskopal/orm^1.0
Installation
The
ext-decimalextension must be installed separately. See php-decimal.io for installation instructions.
Usage
Apply the #[ColumnDecimal] attribute to a Decimal property on your ORM entity. The precision and scale parameters map directly to the SQL DECIMAL(precision, scale) column type.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
precision |
int |
yes | Total number of significant digits (must be > 0) |
scale |
int |
yes | Digits after the decimal point (must be < precision) |
name |
string |
no | Override the database column name |
nullable |
bool |
no | Allow null values (default: false) |
How It Works
ColumnDecimal— a PHP attribute that extends the ORM'sColumnattribute withType::Decimaland registersDecimalMapperas its value handler.DecimalMapper— implementsMapperInterface, converting database strings toDecimal\Decimalobjects on read (mapToProperty) and back to strings on write (mapToColumn).
License
MIT — see LICENSE.
All versions of orm-decimal with dependencies
ext-decimal Version *
php-decimal/stubs Version ^1.1.0
marekskopal/orm Version ^1.0