Download the PHP package byng-systems/pimcore-doctrine-library without Composer
On this page you can find all versions of the php package byng-systems/pimcore-doctrine-library. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download byng-systems/pimcore-doctrine-library
More information about byng-systems/pimcore-doctrine-library
Files in byng-systems/pimcore-doctrine-library
Package pimcore-doctrine-library
Short Description Byng pimcore doctrine library
License MIT
Homepage https://github.com/byng-systems/pimcore-doctrine-library
Informations about the package pimcore-doctrine-library
Pimcore doctrine plugin
This plugin allows developers to use doctrine orm to manage objects outside of pimcore.
Usage
Installation
Add the plugin in composer.json
You will also need to add a post-install script to install the doctrine cli script. If you don't add the following line then you will have to manually copy 'cli-config.php' from inside the plugin folder to your document root.
Setup
Add the following to 'website/var/config/startup.php'. Set the $entityDir to wherever you wish to create your entities.
You can store the entity manager reference ($em) in your DI container or Zend_Registry if you wish. You can also retrieve it from the setup class from anywhere in your code base:
Test
Open a terminal and 'cd' to your document root and run the following command:
You should see a list of all available doctrine commands
Example
Create a product entity
NB: You'll probably have to add the 'Entity' namespace to your autoloader.
website/lib/Entity/Product.php
Create the products table using the doctrine cli
Create a repository class to handle product entities
website/lib/Entity/Repository/ProductRepository.php
Finally we can write code to persist our entity