public static function getLast() {
		
		$class = get_called_class();

		// check about single primary key
		if ($class::hasCompoundKey()) {
			return NULL;
		}
		
		// check if auto-increment key
		$db = Database::getInstance();
		if (!$db->isAutoIncrement($class::TABLE_NAME)) {
			return NULL;
		}
		
		// cast to string
		$tableKey = (is_array($class::TABLE_KEY) and array_key_exists(0, $class::TABLE_KEY)) ? $class::TABLE_KEY[0] : $class::TABLE_KEY;

		$db->setQuery('SELECT * FROM `' . $class::TABLE_NAME . '` ORDER BY `' . $tableKey . '` DESC LIMIT 1');
		$obj = $db->loadObject();

		return (is_a($obj, 'stdClass') ? new $class($obj) : NULL);
		
	}
public static function getLast() {
		
		$class = get_called_class();

		// check about single primary key
		if ($class::hasCompoundKey()) {
			return NULL;
		}
		
		// check if auto-increment key
		$db = Database::getInstance();
		if (!$db->isAutoIncrement($class::TABLE_NAME)) {
			return NULL;
		}
		
		// cast to string
		$tableKey = (is_array($class::TABLE_KEY) and array_key_exists(0, $class::TABLE_KEY)) ? $class::TABLE_KEY[0] : $class::TABLE_KEY;

		$db->setQuery('SELECT * FROM `' . $class::TABLE_NAME . '` ORDER BY `' . $tableKey . '` DESC LIMIT 1');
		$obj = $db->loadObject();

		return (is_a($obj, 'stdClass') ? new $class($obj) : NULL);
		
	}
public static function getLast ( ) { $ class = get_called_class ( ) ; // check about single primary key if ( $ class :: hasCompoundKey ( ) ) { return NULL ; } // check if auto-increment key $ db = Database :: getInstance ( ) ; if ( ! $ db -> isAutoIncrement ( $ class :: TABLE_NAME ) ) { return NULL ; } // cast to string $ tableKey = ( is_array ( $ class :: TABLE_KEY ) and array_key_exists ( 0 , $ class :: TABLE_KEY ) ) ? $ class :: TABLE_KEY [ 0 ] : $ class :: TABLE_KEY ; $ db -> setQuery ( 'SELECT * FROM `' . $ class :: TABLE_NAME . '` ORDER BY `' . $ tableKey . '` DESC LIMIT 1' ) ; $ obj = $ db -> loadObject ( ) ; return ( is_a ( $ obj , 'stdClass' ) ? new $ class ( $ obj ) : NULL ) ; }
Return last insert record object for single, auto-increment primary key.

@return	NULL|Mixed
Return last insert record object for single auto - increment primary key .