Quantcast
NRSoft

Tag Archives: Symfony

Filter Doctrine collections

Let’s assume the following scenario where you have a Product entity linked to a Category entity by a ManyToOne relationship. In your twig template you want to loop on all categories and display a list of products for each of them. The {{ category.products }} will give you that … no problem. Now imagine you […]

Sonata Media fixed dimensions resizer

We assume that you have SonataMediaBundle up and running in your project and have extended the bundle with SonataEasyExtendsBundle in your Application folder. Next, add the following class in your extended bundle in a Resizer folder <!–?php namespace ApplicationSonataMediaBundleResizer;use ImagineImageImagineInterface;use ImagineImageBox;use GaufretteFile;use SonataMediaBundleModelMediaInterface;use ImagineImageImageInterface;use ImagineExceptionInvalidArgumentException;use SonataMediaBundleMetadataMetadataBuilderInterface;use SonataMediaBundleResizerResizerInterface;class FixedDimensionsResizer implements ResizerInterface{    protected $adapter;    protected $mode;    protected […]

Symfony 2 meets Oracle (part 3)

Configuration First of all you will need to configure the database connection. We will assumme you have followed the previous tutorials and have an Oracle XE database. parameters:     database_driver: oci8     database_host: your_VM_IP     database_port: ‘1521’     database_name: XE     database_user: your_username     database_password: your_password     database_charset: AL32UTF8 Database charset is by default AL32UTF8 […]

Symfony 2 meets Oracle (part 2)

If you have followed the part 1 and downloaded the VM I suggested, it is important to know that your database name is called “XE”. It will be useful in next chapter on Symfony configuration. Oracle configuration Open a terminal and start the configuration process with the following command > /etc/init.d/oracle-xe configure  Create a worspace […]

Symfony 2 meets Oracle (part 1)

Downloading the VM First of all you need to get Virtualbox for your operating system https://www.virtualbox.org/wiki/Downloads Then you need to create an account on the Oracle website (if you don’t have one already) and get the Enterprise PHP Development VM http://www.oracle.com/technetwork/community/developer-vm/index.html Configuring the VM Import the VM in Virtualbox (File > Import Appliance) and follow […]