dev-master
9999999-dev https://github.com/beldougie/CommonBundleA collection of classes commonly used throughout my projects
MIT
The Requires
by Matt Keeble
abstract doctrine2 entities doctrine-extensions doctrine-fixtures
A collection of classes commonly used throughout my projects
A collection of classes commonly used throughout my projects, (*1)
This package is currently broken. It's experimental and in the very early stages of development so please don't use it if your project is critical... it's no good for that!, (*2)
If you want to make suggestions though or get involved, you're welcome to. Give me a shout., (*3)
This bundle incorporates stof\DoctrineExtensionsBundle and doctrine\DoctrineFixturesBundle to make working with entities slightly easier., (*4)
The entities included are:, (*5)
Useful class that adds a standard, integer-based id field and timestampable behaviour on insert and update, (*6)
TODO, (*7)
A class that adds basic information about a person. Firstname, lastname and date of birth fields are added to any Entity extending from this class., (*8)
TODO, (*9)
There are issues in using Enums in a sqlite database. Mainly because it doesn't support an Enum or anything like it..., (*10)
So, the BaseLookup makes it easy to add lookup or reference tables to your database as related entities., (*11)
TODO, (*12)
TODO, (*13)
TODO, (*14)
TODO, (*15)
add the requirement to your composer.json, (*16)
{ "require": { "beldougie/beldougie-common-bundle": "*" } }
// app/AppKernel.php public function registerBundles() { $bundles = array( //.. new Symfony\Bundle\DoctrineFixturesBundle\DoctrineFixturesBundle(), new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(), new Beldougie\CommonBundle\BeldougieCommonBundle(), //.. ) }
At present, the only configuration options necessary to add are those for Timestampable from the stof\DoctrineExtensionsBundle, (*17)
You must activate timestampable as the abstract entities included in this bundle use Timestampable in their annotated configuration., (*18)
For more detailed information about using other aspects of the DoctrineExtensionsBundle see the documentation, (*19)
# Stof Doctrine Extensions stof\_doctrine\_extensions: orm: default: timestampable: true
NB: This section is only relevant if you need to run the BeldougieCommon tests directly within your application for some reason, for example to if you have configuration issues or you want to work on the bundles., (*20)
If you run the tests without having configured a test database, you WILL destroy ALL of your data irrecoverably., (*21)
By default, phpunit will only run tests located in the src/ folder. For this reason, if you don't want to run the tests you don't need to ready any further., (*22)
Due to the nature of this bundle the tests included rely on a database. They utilise data fixtures and load automatically when run. Each setup will generate the schema while each teardown DROPS the schema., (*23)
We recommend copying phpunit.xml.dist to phpunit.xml and making these changes there. If you add phpunit.xml to .gitignore, it will not get saved in git and the tests will only get run locally on your system and not in a deployment or CI process., (*24)
<testsuites> <testsuite name="Project Test Suite"> <!-- .... --> <directory>../vendor/beldougie/beldougie-*-bundle/Beldougie/*Bundle/Tests</directory> <!-- .... --> </testsuite> </testsuites>
Note the "*" wildcard. Currently, My other bundle(s) use the same naming configuration, so you will only need to do this once., (*25)
In your app/config/config_test.yml, add the following, (*26)
// app/config/config_test.yml doctrine: dbal: driver: pdo_sqlite host: localhost dbname: db_test user: db_user charset: UTF8 password: db_pwd memory: true orm: auto_generate_proxy_classes: true
A collection of classes commonly used throughout my projects
MIT
abstract doctrine2 entities doctrine-extensions doctrine-fixtures