Skip to content

Instantly share code, notes, and snippets.

@gries
Created October 10, 2011 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gries/1275200 to your computer and use it in GitHub Desktop.
Save gries/1275200 to your computer and use it in GitHub Desktop.
Propel-ORM BLOB access
<?php
$object = ObjectQuery::create()->findOneById(1);
// load blob content
$content = stream_get_content($object->getImage());
// content now holds the image data
var_dump($content);
// ...
// ...
// ...
$object = ObjectQuery::create()->findOneById(1);
// load blob content again
$content = stream_get_contents($object->getImage());
// content now is "" because the stream was read before
var_dump($content);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment