Hi All,

I don´t know if this is the right way to be thinking, and I can´t
find any results for similar queries (I seem to recall a similar Q a
while ago, but can´t find it) ... I would like to use a model to refer
to objects on the file system - if this isn't a silly idea, has anyone
done something similar already, and has some useful hints?

Some background: Basically I have some normal DB models, and 0-n
pictures associated with each object.

The pictures are stored in img/ObjectName/ObjectID/Filename

At the moment I have the following method defined in app_model:
        function _getPics()
        {
                uses("Folder");
                $dir = WWW_ROOT.'img'.DS.$this->name.DS.$this->id;
                $Folder = new Folder($dir,true);
                return $Folder->find ('.*');
        }

After a while I wondered if it might be sensible to make a Pic model,
if only so that I could store comments against each pic in a tidy
way... Thoughts?

Cheers,

AD7six


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to