Download the PHP package webforge/doctrine-compiler without Composer
On this page you can find all versions of the php package webforge/doctrine-compiler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download webforge/doctrine-compiler
More information about webforge/doctrine-compiler
Files in webforge/doctrine-compiler
Package doctrine-compiler
Short Description Generate your doctrine entities metadata from a simple json file, including the php code for the entity
License MIT
Informations about the package doctrine-compiler
webforge-doctrine-compiler
Generate your doctrine entities metadata from a simple json file, including the php code for the entity
usage
A very basic model (with one entity) could look like this:
The compiler will create this entity for you:
You have the option to use this code and just copy n paste it into your (doctrine)-project. Another option is to put the json model into your project and include the compiler as a dev dependency. If someone changes the model, the entities can be recompiled. You just have to cross the generation-gap here:
CompiledUser.php
User.php
This way your developers should never touch the Compiled** - Entities and always alter the extended classes. This way you're able to easily add new properties to your entities, or change relations between them.
Installation
The best way to use the doctrine compiler is to install it as a development tool on your machine.
I recommend to put the global composer bin directory (~/.composer/vendor/bin
or %APPDATA%\composer\vendor\bin
) in your PATH.
Running
You can then compile your entities with the binary installed by composer. You have to provide the location of your json model file and the PSR-1 target-directory for your Entities.
This will create the entities within a PSR-1 named directory in src/php
Known Issues
- OneToMany, self-referencing Assocations are not yet supported
- the primary defaultId with name 'id' is hardcoded on many cases (you are encouraged to use such an id)
LICENSE
The MIT License (MIT)
Copyright (c) 2015 webforge
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
All versions of doctrine-compiler with dependencies
webforge/webforge Version ~1.11.0
webforge/serializer Version 1.0.*
beberlei/assert Version 1.6.*@stable