This is a bit of bonus material to help identify some of the things you can do by extending the default processors.
Extending the Processors for our CopyrightedResource is fairly simple. Load up your copyrightedresource.class.php file that contains your main class, and at the top, put this:
This tells MODX to load some base classes that we'll need – yes, we're sort of double-dipping here. Because our main class file is on MODX's radar and will be included when MODX loads, we just can require more files from there. At the bottom of the same file, after your CopyrightedResource class, put this:
Now we've overridden the processors for our class; MODX will automatically use these classes as the processor class when creating or updating our CRC. We can then override methods to provide custom functionality for our CopyrightedResource class. For example, here is a stub for our CopyrightedResource class and the Update processor that shows some methods that you could override:
These are just trivial examples, but hopefully you get the idea. If you've been paying close attention to our examples on these pages, you may have noticed that we set some properties in the CopyrightedResource class (class_key), and we set others in CopyrightedResourceUpdateProcessor (cacheable, isfolder). This may leave you confused as to where you should modify a behavior – in the resource child class? In the controller class? or in the processor?
If the attribute is something that can be controlled by the GUI, then you'll have to do some customizations in the processors.
There are some attributes that are not in the modx_site_content table. See the comments in the modresource.class.php file for a list of attributes. You can set them in your resource class via the set method, e.g.:
And that's about it! There's obviously tons of possibilities with CRCs, and you can really go nuts on the customization that you can apply to them and their processing and rendering logic. Have fun!