
Investigate adding 'property' parameter to DM::Type.dump
Reported by Mike Roberts | April 10th, 2008 @ 03:12 AM
As discussed in IRC, there may be a use case where a type needs to know a little bit about the context it is being used in.
For instance, I am writing a custom type that will handle attachments that are stored on the filesystem. When saving the post, we'd want to save the file somewhere on the filesystem, but to do this we might want to know what model we're being saved in, and what property... so I could save a post attachment to public/posts/attachments/blah.zip or a user's avatar to public/users/avatars/blah.
Access to two parts of information would be nice: the model name and the property name.
Another one that might be useful, if possible, is the id or key of the object it belongs to. I know this may be trickier.
I've patched my local system to support passing the 'property' object which gives you the property name and model and it is attached.
Comments and changes to this ticket
-
Dan Kubb (dkubb) April 14th, 2008 @ 05:21 PM
- Milestone cleared.
- State changed from new to open
-
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »