# css-javascript-toolbox/8.0.2/tables/template-revision.php

CSS &amp; JavaScript Toolbox, version 8.0.2. 43 lines.

- Page: https://pluginprobe.com/plugins/css-javascript-toolbox/8.0.2/code/tables/template-revision.php
- Raw: https://pluginprobe.com/plugins/css-javascript-toolbox/8.0.2/raw/tables/template-revision.php
- Modified: 2014-05-06T16:47:26+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/css-javascript-toolbox/8.0.2/code/tables/template-revision.php#L10-L20`.

```php
<?php
/**
* @version $ Id; ?FILE_NAME ?DATE ?TIME ?AUTHOR $
*/

// Disallow direct access.
defined('ABSPATH') or die("Access denied");

/**
* 
* DESCRIPTION
* 
* @author ??
* @version ??
*/
class CJTTemplateRevisionTable extends CJTxTable {
	
	/** */
	const FLAG_LAST_REVISION = 0x01;
	
	/**
	* put your comment there...
	* 
	*/
	public function __construct($dbDriver) {
		parent::__construct($dbDriver, 'template_revisions');
	}
	
	/**
	* put your comment there...
	* 
	* @param mixed $templateId
	*/
	public function fetchLastRevision($templateId) {
		$attributes = self::FLAG_LAST_REVISION;
		$query = "SELECT *
													FROM #__cjtoolbox_template_revisions
													WHERE templateId = {$templateId} AND (attributes & {$attributes})";
		$this->load($query);
		return $this;
	}
	
} // End class.
```
