WordPress Tip - Get Post Type in Admin

I was busy writing a plugin today and was needing to know which post type I was dealing with in the WordPress admin. I must have done this a dozen times before and I seem to write it slightly differently every time, so I set out to find a single function that I can use going forward.

Works a charm and now I can use it like this:

if ( $this->get_current_post_type() == 'page' ) {