hectororm / data-types
Hector Data Types
v1.0.0
2025-07-02 12:31 UTC
Requires
- php: ^8.0
- ext-mbstring: *
- ext-pdo: *
Suggests
- ramsey/uuid: To use ramsey/uuid library as entity property type
This package is auto-updated.
Last update: 2025-07-02 14:20:25 UTC
README
Note
This repository is a read-only split from the main HectorORM repository.
For contributions, issues, or more information, please visit the main HectorORM repository.
Do not open issues or pull requests here.
Hector Data Types is the module to manage types of Hector ORM. Can be used independently of ORM.
Installation
You can install Hector Data Types with Composer, it's the recommended installation.
$ composer require hectororm/data-types
Usage
Each type converter implement interface:
use Hector\DataTypes\ExpectedType; interface TypeInterface { /** * From schema function. * * @return string|null */ public function fromSchemaFunction(): ?string; /** * From schema to entity. * * @param mixed $value * @param ExpectedType|null $expected * * @return mixed */ public function fromSchema(mixed $value, ?ExpectedType $expected = null): mixed; /** * To schema function. * * @return string|null */ public function toSchemaFunction(): ?string; /** * From entity to schema. * * @param mixed $value * @param ExpectedType|null $expected * * @return mixed */ public function toSchema(mixed $value, ?ExpectedType $expected = null): mixed; /** * Get binding type. * Must return a PDO::PARAM_* value. * * @return int|null */ public function getBindingType(): ?int; }
Attempted excepted type is a PHP representation of a property type.