<?php
/**
 * Contains the status change activity type.
 *
 * 
 * @license GPLv2
 */

/**
 * Class IT_Exchange_Txn_Status_Activity
 */
class IT_Exchange_Txn_Status_Activity extends IT_Exchange_Txn_AbstractActivity {

	/**
	 * Retrieve a status activity item.
	 *
	 * This is used by the activity factory, and should not be called directly.
	 *
	 *
	 *
	 * @internal
	 *
	 * @param int                            $id
	 * @param IT_Exchange_Txn_Activity_Actor $actor
	 *
	 * @return IT_Exchange_Txn_Status_Activity|null
	 */
	public static function make( $id, IT_Exchange_Txn_Activity_Actor $actor = null ) {

		$post = get_post( $id );

		if ( ! $post instanceof WP_Post ) {
			return null;
		}

		return new self( $post, $actor );
	}

	/**
	 * Get the type of the activity.
	 *
	 *
	 *
	 * @return string
	 */
	public function get_type() {
		return 'status';
	}
}
