I am working with subsites module. I need to make uploaded files be available to all subsites or only to one subsite.
To achive this I decorate class File and add to it field Global (boolean). If it is true, the file will be available to all subsites.
In subsites module there is function to disable/enable filtering by subsites when geting data using DataObject::get, but it not work for files. There is decorator for class File in Subsites module, but in this decorator disabling/enabling subsite filter does not work (there is no code for that). In my decorator I add augmentSQL function and remove filtering from where statement in the query (this is added by subsite's decorator).
It works, my decorator processes later than subsites' decorator.
My team leader do not want to change modules becouse of possible updates, etc.
It is the first issue. :) The second is following.
I want to add possibility for dataobjects or pages be available to all subsites or only to one subsite, as with files. But not to add code to each dataobject or page type I will create, but decorate dataobject(sitetree) class and make this functionality be available to new classes. I want to use decorator to achieve this, as I do with files. For this I need to know order of decorators.
Can you recommend other approach instead of using decorators? I will be very grateful.