The method needs to be public. Otherwise, it cannot be called outside (by Gii, for example).