Download the PHP package cyril-verloop/doctrine-entities without Composer
On this page you can find all versions of the php package cyril-verloop/doctrine-entities. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cyril-verloop/doctrine-entities
More information about cyril-verloop/doctrine-entities
Files in cyril-verloop/doctrine-entities
Package doctrine-entities
Short Description Some default doctrine entity/fields requiring PHP >=8.2 and Doctrine ORM 3.2.
License MIT
Informations about the package doctrine-entities
doctrine-entities
Some default doctrine entity/fields requiring PHP >=8.2 and Doctrine ORM >=3.2.
For compatibility with Doctrine ORM <3.2 , see version <8.0 of this software.
This includes :
AbstractIntId: a mapped superclass with an$idas an integer identifier/primary key;IntId: a trait that adds an$idas an integer identifier/primary key;IntIdInterface: an interface for integer id;Active: a trait that adds an$activeboolean field;Available: a trait that adds an$availableboolean field;Priority: a trait that adds a$priorityinteger field;Slug: a trait that adds a$slugtext field;Name: a trait that adds a$nametext field;Description: a trait that adds a$descriptiontext field;NullableDescription: a trait that adds a nullable$descriptiontext field;ConnectedAt: two traits that add a$connectedAtfield (choose between \DateTime() or \DateTimeImmutable());CreatedAt: two traits that add a$createdAtfield (choose between \DateTime() or \DateTimeImmutable());UpdatedAt: two traits that add a$updatedAtfield (choose between \DateTime() or \DateTimeImmutable()).
Installation
As a Composer depedency
In your project directory run
For development purposes
Mappings
There are attributes and XML mappings.
Symfony
To you use with Symfony, copy the attribute or XML configuration below
and add it to the config/packages/doctrine.yaml file of your project.
You can also look at the resources/config/packages/doctrine.yaml file.
XML
Entity
The XML file is located in the config/doctrine/ directory.
You just have to copy or reference it depending on your needs.
Traits
You need to copy the require configuration in your XML file.
For example :
You can also look at the resources/mappings/Example.orm.xml file.
Usage
AbstractIntId / IntId / IntIdInterface
If your entities need an integer as an identifier/primary key :
-
they can extend the mapped super class
CyrilVerloop\DoctrineEntities\AbstractIntId -
use the
CyrilVerloop\DoctrineEntities\IntIdtrait - implement the
CyrilVerloop\DoctrineEntities\IntIdInterfaceinterface
Active / Available / Priority / Slug / Timestampable ...
If your entities need some other fields, they can use a trait.
Continuous integration
Tests
To run the tests :
The generated outputs will be in ./ci/phpunit/.
Look at ./ci/phpunit/html/index.html for code coverage
and ./ci/phpunit/testdox.html for a verbose list of passing / failing tests.
To run mutation testing, you must run PHPUnit first, then :
The generated outputs will be in ./ci/infection/.
Static analysis
To do a static analysis :
Use "--report=./psalm/psalm.txt --output-format=text" if you want the output in a file instead of on screen.
PHPDoc
To generate the PHPDoc :
The generated HTML documentation will be in ./ci/phpdoc/.
Standard
All PHP files in this project follows PSR-12. To indent the code :