Renamed argument to prevent unset value.
Stashed events array cleaning into own function.
Allow get event by objects id.
Created database method that allows to get events by object id.