views:

285

answers:

1

I am using Propel (1.4) with Symfony 1.31 (with mySQL db). I want to save save/retriev BLOB (gzipped) data to/from the database

My db schema is defined in YML.

Suppose the schema looks like this:

demo_blobbed_object:
  _attributes: { phpName: MrBlobby }
  id:
  name: {type: varchar(32)}
  data: {type: ? }

I have the following questions

  1. What is the type: value for a BLOB field type in YML?
  2. Can I use the normal getter setter methods to get/set the blob data from a MrBlobby object?

The propel documentation says here that the _toString() method needs to be called, but it is not clear if this still applies to Propel 1.4

A: 

It should be BLOB or CLOB depending on what is appropriate for your usage. In your case i would think BLOB...

http://propel.phpdb.org/trac/wiki/Users/Documentation/1.4/Schema-Reference

As far as setting/getting im not sure as ive never stored an image/gz/etc. in a db when using Propel before so ive never had to use it. However this may answer your questions:

http://propel.phpdb.org/trac/wiki/Users/Documentation/1.4/LOB-Columns

prodigitalson
tx - do you have any idea about the getter/setter methods?. Did this chaneg in v1.4?
Stick it to THE MAN
see my edit above :-) **EDIT**: i added a link to the docs directly which i think give you a difinitive answer to your usage question.
prodigitalson
Yup, that fully answers my question - thanks
Stick it to THE MAN