The sfDoctrineActAsSerializablePlugin plugin automates the handling of
serializable columns. Each time a Serializable object is read from
the database, the appropriate columns are unserialized, each time it is
saved - the column values are seralized back.

Developers

License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Changelog for release 1.0.0 - 10/02/2012

Other releases

Release 1.0.0 - 10/02/2012

sfDoctrineActAsSerializablePlugin

The sfDoctrineActAsSerializablePlugin plugin automates the handling of
serializable columns. Each time a Serializable object is read from
the database, the appropriate columns are unserialized, each time it is
saved - the column values are seralized back.

Instalation

Install the plugin via the subversion repository by executing the following
command from the project root directory:

Usage

You don't have to worry about (un)serializing data when reading the data from
and saving it to the database. Everything will be done automatically from now
on. It's extremely useful when you want to keep array values in the database.

Set the fields that are going to be serializable. Doctrine will create new
columns with their names concatenated with the column_suffix. In the above
example, the Xxx model woud have features_srlzd and attributes_srlzd
columns.

no postConstruct

The problem with Doctrine is that there can be no postConstuct hook called after
a new record is created. The topic
was started in 2009 and there has been no solution for the 1.x Doctrine branch
yet. Hence, the hook had to be done in a different way, unfortunately. Each
model that uses the Serializable behavior should have the construct method
implemented with one extra line, just as below: