** I need to somehow call the ID from my page search in this Link function on my dataobject decorator. Then I need to get dataobject by ID. How can I call the ID from the page_controller search function in this link function? ** My total lack of PHP and OO programming is letting me down.
You see via my page search function I am searching using sphinx and finding my dataobjects returned directly to Page_results.ss. They are just not linked correctly :).
That function I posted should be placed in your DataObject, it will then return the correct link when it is rendered on the Page_results page. As it is rendered the results control loop is inside the DO so the function needs to reference it's own objects ID, hence the $this->ID bit at the end.
I'm pretty sure that is how it's done, but Mark may know better :)
this should not be in your decorator, it should be in your actual data object, and you should be using the DataObject::get_one() to get the holder, not the DO itself, we are in the DO so all we need to do to return that is $this.
I think the function in my more recent post is closer to what you want.
You need to grab the page that displays the DO, and then append the rest of the link onto the end of that pages Link() function, which is what that function I wrote did. so using what I understand of your names it should be something like this:
@aram Thanks for all the help, shout if you need any with the sphinx process.
@mark I pasted my DO code here: http://pastebin.com/TkMuT7hL
I still cannot manage to index 'Document' => 'File' on my DecidedCases DO. FileContentCache remains clear. I am not sure if my relationships are setup correctly or whether I am understanding the application of your code incorrectly.