make trait into a event object; code seems a bit simpler.
added possible value of 'null' as @param annotation.
removed unused argument, $this->perPage.
make sure to set sql type.