TAG | LooseCoupling
6
Taking snapshots – manipulating Doctrine collections
1 Comment · Posted by Christian in The right tool
Ok, when would you ever want to manipulate a doctrine collection you may wonder.
Well for example if it contains records that don’t really belong there. So you iterate over them and throw them out, right?
Only halfway there because doctrine collections have a memory and have secretly taken snapshots!
3
How to customise doctrine behaviours the right way!
3 Comments · Posted by Christian in The real job
All of you who work with doctrine will know about the behaviours feature. If you don’t go and dig the documentation!
Sometimes you might be tired to use the same behaviour on all your models with all the same options littering your schema.yml.
This is where I started and this is what I found.
19
Performance tweaking for symfony plugin gjPositionsPlugin and bugfixes for doctrine behaviour LooseCoupling
No comments · Posted by Christian in The real job

Yesterday brought some updates to both gjPositionsPlugin as well as LooseCoupling. Both were more or less directly related.
When my team laid their hands on the plugin they almost instantly found some nicely hidden bugs so I had to get busy again which proved a quite intense experience.
In the end result the plugin also gained an option to dramatically reduce the number of queries in the admin modules of your composition-able models.
17
Easy page composition with symfony, doctrine and the gjPositionsPlugin is now BETA!
1 Comment · Posted by Christian in The real job
For quite some time now I keep blogging about page composition in symfony. Even when I blogged about LooseCoupling I was actully talking about a by-product of gjPositionsPlugin.
Today I am happy to announce that this plugin is now available in its first beta version!
Not only I managed to implement the basic idea of composing design and content elements on a canvas; by now the plugin became completely independent from your models and database structure!
(more…)
admin generator · admin-theme · Behaviours · Doctrine · gjPositionsPlugin · LooseCoupling · Plugin · plugins · Separation of Concerns · symfony
10
First demonstration of current implementation status of gjPositionsPlugin for easy symfony/doctrine page composition
No comments · Posted by Christian in The real job
For a while i am now working on a plugin to allow easy page composition. I wrote about the basic idea previously.
gjPositionsPlugin has seen quite some change since as it turned into a doctrine behaviour and symfony admin theme combination. Now the main thing left is some jQuery action to add usability.
Unfortunately the current structure does not allow easy collaboration as the plugin only defines functionalities that can be incorporated by your application. It does not work standalone. That’s why I had the idea of another plugin for demonstration purposes only. (more…)
Doctrine · gjPositionsPlugin · LooseCoupling · Plugin · plugins · sfDoctrineDynamicFormReleationsPlugin · symfony
25
Doctrine behaviour LooseCoupling now collects garbage with a new deletion cascade
2 Comments · Posted by Christian in The right tool
When you loosely couple your doctrine models with the doctrine behaviour LooseCoupling there is a chance that on the active side (the one holding the relation information) you will get a lot of orphaned entries over the times for each deleted item on the passive side.
Well, this is no longer the case now.
Many of you will have played around with Doctrine behaviours before. I certainly did and one of my latest experiments is the LooseCoupling behaviour that allows you to work with loose relations without leading to high amounts of database queries.
Today I found a bug in this behaviour that was the result of my apparent misunderstanding.
27
[symfony workshop] How to implement a flexible home page composition admin tool with LooseCoupling?
My employer is a big magazine publishing house and in the three years working there I had the opportunity to work on or just follow the development of more than 20 editorial websites. These included very different types of sites; some community driven, some purely editorial, some service providing and more.
There have been many differen requirements but most of the time the requested features were reoccuring in similar ways.
One of most frequently requested feature was to provide an admin tool to compose homepage (a.k.a. indexpages, sectionhomes, channels,..). An editor should be able to compose the layout of a homepage by positioning design elements like top teasers, slideshows, two column boxes, three column boxes and so forth and furthermore he should be able to manually assign contents to those elements. These contents of course can be of various types like article, galleries, doissiers, quizzes, etc..
This is my approach to solve this requirement once and for all!
architecture · Code Quality · Cohesion · Coupling · Doctrine · LooseCoupling · Separation of Concerns · symfony
24
LooseCoupling – a Doctrine extension for type independent hydration of loosely coupled relations
6 Comments · Posted by Christian in The real job
One of the many strengths of Doctrine ORM is how it deals with relations. No matter if you’re fetching records or arrays it is drop dead simple to include related data in your result.
But what if there is no real relation but only one by convention? What about loosly coupled data that is not referenced by a foreign key but by two fields containing the model and the primary key? What is easy enough to understand for a human machines should be able to manage too.
architecture · Code Quality · Cohesion · Coupling · Doctrine · LooseCoupling · Separation of Concerns

