Doctrine and inheritance

While working with Symfony of course also Doctrine crosses your way. And it is really handy in my use case: I have a MySQL database that was designed 12 years ago and contains lots of Don’ts. On of these is that there are images in a table assigned to parent entities that are located in two different tables. This is controlled by one column in the image table: AssignmentType which contains TypeA oder TypeB.

I was already thinking about moving that to two image tables when I discovered Doctrine’s single table inheritance. It is made especially for that use case and works quite perfect and your application doesn’t even know about that.

Type A

Type B

Image

ImageA

ImageB

 

GD Star Rating
loading...

Symfony and PHPStorm

As already mentioned I’am playing around with Symfony 2 at the moment and of course I want to use my favorite IDE: PHPStrom.

I was not surprised that integation into PHPStorm is very good:

So for setting up follow this guide.

Also a plugin is available but for me it does not bring that much extra use.

For me the only pitfall was that I was not used to copy assets to the webfolder by assets:install (not needed when using assetic). And this took me quite a while.

But still form my point of view there is at the moment no better IDE for PHP development than PHPStorm, also when working with Symfony 2.

GD Star Rating
loading...

Symfony 2, SwiftMailer and 1und1 shared hosting

At the moment I playing around with Smfony2. One of the things I wanted to do is sending an email via form. Therefore of course I used Swift_Mailer component which worked very good in local dev environment. But after deploying to 1und1 hosted webspace I received error that neither localhost nor smtp.1und1.de could be connected to from the webspace.

After lots of research I found out that the mailserver hostname is mrvnet.kundenserver.de and then it worked.

I hope that this saves someone some hours or minutes.

GD Star Rating
loading...