# css-javascript-toolbox/8.0.3/models/block-templates.php

CSS &amp; JavaScript Toolbox, version 8.0.3. 36 lines.

- Page: https://pluginprobe.com/plugins/css-javascript-toolbox/8.0.3/code/models/block-templates.php
- Raw: https://pluginprobe.com/plugins/css-javascript-toolbox/8.0.3/raw/models/block-templates.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.3/code/models/block-templates.php#L10-L20`.

```php
<?php
/**
* 
*/

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

/**
* 
*/
class CJTBlockTemplatesModel extends CJTHookableClass {

	/**
	* Check weather a template is linked to specific block.
	* 
	* Check database block_templates table for record with the given ids.
	* 
	* @param Integer Block Id.
	* @param Integer Template Id.
	* @return boolean TRUE if linked, FALSE if not.
	*/
	public function isLinked($blockId, $templateId)	{
		// Try to load block template table with the requested Ids.
		$tableBlockTemplate = CJTxTable::getInstance('block-template');
		$tableBlockTemplate->set('blockId', $blockId)
																			 ->set('templateId', $templateId)
																			 ->load(array('blockId', 'templateId'));
		// Return TRUE if the blockId and the TemplateId returned from the load process!
		return ($tableBlockTemplate->get('blockId') && $tableBlockTemplate->get('templateId'));
	}

} // End class.

// Hookable!
CJTBlockTemplatesModel::define('CJTBlockTemplatesModel');
```
