jmcameron / attachments

Attachments Extension for Joomla 3, 4, and 5
GNU General Public License v3.0
12 stars 19 forks source link

Finder plugin #5

Open yozmag opened 9 years ago

yozmag commented 9 years ago

I have write a attachment plugin for the finder component, but I think that events like "public function onFinderAfterSave($context) {" are not being throw when a attachment is saved. How can I contribute with my plugin and is the a chance that attachments component start throwing events?

jmcameron commented 9 years ago

Thanks for pointing this out. I think it is possible to do this, but I'll have to do some research. If you would like to collaborate on this, I encourage you to fork this repo and do some experimentation. I'm willing to consider a pull request. You are also free to contact me by email to work together on this outside of github. You can find my email address at the bottom of the Attachments help page.

-Jonathan

yozmag commented 9 years ago

Hello I looking for a place to insert code that will generate a event. On the AttachmentsHelper class I looked at $attachment->store() and a find that is saving the object to the database. Looking at the Joomla docs and MVC framework, this shouldn't be the place. It is confusing to me because you also have a AttachmentsModelAttachment class with a save method which if fine, but i didn't find the place where it is invoked. Can you tell me how can an attachement be saved to the database. Thank you.

jmcameron commented 9 years ago

Yes, the $attachments->store() is where the attachment is stored (not the AttachmentsModelAttachment one). This may not be what Joomla docs/MVC framework recommend, but that is the way it is.

So in AttachmentsHelper after $attachment->store() is the place to insert your code to generate an event.

-Jonathan

yozmag commented 5 years ago

Hi, maybe when updating this component o joomla 4 you can integrate with the finder, please look at https://www.joomlashack.com/blog/tutorials/joomla-4-search/ for more info.