예제 #1
0
 /** static */
 function saveBlob($id, $name, $blob)
 {
     $obj = new sotf_Blob();
     $obj->set('object_id', $id);
     $obj->set('name', $name);
     $obj->find();
     if ($obj->exists()) {
         if ($blob) {
             $obj->setBlob('data', $blob);
         } else {
             $obj->delete();
         }
     } else {
         if ($blob) {
             $obj->create();
             $obj->setBlob('data', $blob);
         }
         // else nothing to do!
     }
 }