Pomm module to use Pomm2 with zf2
If you want to use Pomm 1.x, there's a 1.0 branch.
This package can be installed via composer
https://packagist.org/packages/pomm-project/pomm-module
Just add it to your application configuration file
return array(
'pomm' => array(
'databases' => array(
'con1' => array (
// Mandatory data source name
'dsn' => 'pgsql://postgres:[email protected]/myschema',
// Optional session builder overload
'class:session_builder' => '\Database\ModelManager\SessionBuilder',
),
),
),
);
You can define an optional session builder. As the "Database" module is loaded by default, it's a good idea to define it in.
All generated files will be saved in a "Database" module. You can add your own files like specific SessionBuilder in the module.
# Inspect the configuration
vendor/bin/pomm.php inspect-config
# Inspect a database
vendor/bin/pomm.php inspect-database pstudio2
# Inspect a schema
vendor/bin/pomm.php inspect-schema pstudio2 public
# Inspect a relation
vendor/bin/pomm.php inspect-relation pstudio2 organization people
# Generate the "people" model for "organization" schema
vendor/bin/pomm.php generate-model pstudio2 organization people --force
# Generate the "people" structure for "organization" schema
vendor/bin/pomm.php generate-structure pstudio2 organization people
# Generate the "people" relation for "organization" schema
vendor/bin/pomm.php generate-entity pstudio2 organization people --force
# Generate entity, structure and model for one relation
vendor/bin/pomm.php generate-relation-all pstudio2 organization people
# Generate relation, structure and models for all relations of a schema
vendor/bin/pomm.php generate-schema-all pstudio2 organization
# Generate structure, model and entity file for all relations of all schemas in a database
vendor/bin/pomm.php generate-database-all pstudio2
The tests are not implemented yet. But 'll be launch with
./vendor/bin/phpunit test
- Add a generator for model layer
- Add a generator for ZF2 configuration