pomm-project / pomm-module
Zend Framework 2 Module that provides Pomm2 basic functionality
Installs: 28 766
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 4
Forks: 2
Open Issues: 2
Requires
- php: >=5.4.4
- pomm-project/foundation: 2.0.*@dev
- pomm-project/model-manager: 2.0.*@dev
- zendframework/zend-console: 2 - 3
- zendframework/zendframework: 2 - 3
Requires (Dev)
- phpunit/phpunit: 4.0.7
This package is auto-updated.
Last update: 2024-11-07 18:38:19 UTC
README
Pomm module to use Pomm2 with zf2
If you want to use Pomm 1.x, there's a 1.0 branch.
Installation
This package can be installed via composer
https://packagist.org/packages/pomm-project/pomm-module
Configuration
Just add it to your application configuration file
return array(
'pomm' => array(
'databases' => array(
'con1' => array (
// Mandatory data source name
'dsn' => 'pgsql://postgres:postgres@127.0.0.1/myschema',
// Optional session builder overload
'class:session_builder' => '\Database\ModelManager\SessionBuilder',
),
),
),
);
Session builder
You can define an optional session builder. As the "Database" module is loaded by default, it's a good idea to define it in.
Usage
All generated files will be saved in a "Database" module. You can add your own files like specific SessionBuilder in the module.
Inspection
Config
# Inspect the configuration
vendor/bin/pomm.php inspect-config
Database
# Inspect a database
vendor/bin/pomm.php inspect-database pstudio2
Schema
# Inspect a schema
vendor/bin/pomm.php inspect-schema pstudio2 public
Relation
# Inspect a relation
vendor/bin/pomm.php inspect-relation pstudio2 organization people
Generation
Model
# Generate the "people" model for "organization" schema
vendor/bin/pomm.php generate-model pstudio2 organization people --force
Structure
# Generate the "people" structure for "organization" schema
vendor/bin/pomm.php generate-structure pstudio2 organization people
Entity
# Generate the "people" relation for "organization" schema
vendor/bin/pomm.php generate-entity pstudio2 organization people --force
Relation
# Generate entity, structure and model for one relation
vendor/bin/pomm.php generate-relation-all pstudio2 organization people
All for a given schema
# Generate relation, structure and models for all relations of a schema
vendor/bin/pomm.php generate-schema-all pstudio2 organization
All for a given database
# Generate structure, model and entity file for all relations of all schemas in a database
vendor/bin/pomm.php generate-database-all pstudio2
Tests
The tests are not implemented yet. But 'll be launch with
./vendor/bin/phpunit test
TODO
- Add a generator for model layer
- Add a generator for ZF2 configuration