A lightweight annotation based MVC framework
Note: Doctrine2 must be installed.
The Doctrine2 Entity Manager is provided through the dependency injection container:
/**
* @Request index
*/
public function run()
{
$query = $this->dic->em->createQuery('SELECT * FROM Xframe\Demo\Model\User');
}
It is not loaded until first use and it uses the database settings in the configuration file.
If you cd to the root directory of your project the doctrine
cli program will detect the cli-config.php bootstrap and use the xFrame Entity Manager instance.
$ cd /var/www/example.org
$ doctrine orm:schema-tool:create
Since version 1.2.0
, Doctrine migrations are available to use in project.
In case you are using custom namespace prefix, you probably will need to override the cli script.
This is also available for you:
bin/migration.script
vendor/linusnorton/xFrame/bin/migration
vendor/linusnorton/xFrame/bin/migration-cli
In project root you should also have migration configuration file migrations.yml
:
name: xFrame Doctrine Migrations
migrations_namespace: Migration
table_name: doctrine_migration_version
migrations_directory: doctrine-migration
More help: just run ./vendor/bin/migration