Download the PHP package xactsystems/type-hint-hydrator without Composer

On this page you can find all versions of the php package xactsystems/type-hint-hydrator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package type-hint-hydrator

type-hint-hydrator

A Symfony Type Hint hydrator that uses declared types and @var annotations to determine the hydrated type. Under the hood it uses the laminas-hydrator for the mapping process. See https://github.com/laminas/laminas-hydrator/

It can handle request objects and arrays of data to hydrate annotated classes and arrays etc. It can also validate against any Assert annotations the hydrated object may contain.

If properties of the hydrated object are annotated as Doctrine Entities, the hydrator will attempt to load the entity for the key value provided. We currently don't support composite keys.

Documentation


1) Add the type-hint-hydrator to your project

2) Add the bundle to your configuration file

If you are using Symfony 4 onwards and using Flex you can skip this step.

Symfony 4.4 onwards - bundles.php

3) Declare types or annotate your hydrated object properties

4) Hydrate your object in your controller

Or to update and existing entity:

5) Smile and be happy

It really is that easy. No more form types! Annotate your objects correctly with types and assertions, make sure your submitted forms use the same names as your object proprieties and it will just work!

Create proper Model classes for your data and hydrate them, and let them do the work a proper MVC model should.

Methods

hydrateObject

Hydrate an object from an array of values. If $validate is true, the hydrated object is validated against annotations and supplied validation constraints and groups.

handleRequest

Hydrate an object from the Request object. Property mapping is based on the submitted form property names matching the property names of the hydrated object. If $validate is true, the hydrated object is validated against annotations and supplied validation constraints and groups.

isValid

Is the hydrated object valid after processing the validation constraints. If no validation has occurred the method returns true;

getErrors

Return a Symfony\Component\Validator\ConstraintViolationListInterface list of any validation errors.

getJsonErrors

Return a JSON serialised version of getErrors().

Credits


License


This bundle is released under the MIT license. See the complete license in the bundle:

LICENSE


All versions of type-hint-hydrator with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
doctrine/orm Version ^3.2
jms/serializer-bundle Version ^5.0
laminas/laminas-hydrator Version ^4.15
nette/utils Version 4.0
symfony/validator Version ^6.2||7.1
symfony/http-foundation Version ^6.2||7.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package xactsystems/type-hint-hydrator contains the following files

Loading the files please wait ....