PluginProbe
CSS & JavaScript Toolbox / 9.3
CSS & JavaScript Toolbox v9.3
trunk 0.3 0.8 10 10.1 11 11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 11.9.1 12 12.0 12.0.1 12.0.3 12.0.4 12.0.5 12.0.6 12.0.7 6.0 6.0.11 All 60 releases
css-javascript-toolbox / models / block-templates.php

block-templates.php in CSS & JavaScript Toolbox 9.3, at models/block-templates.php

36 lines 1012 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 *
4 */
5
6 // Disllow direct access.
7 defined('ABSPATH') or die('Access denied');
8
9 /**
10 *
11 */
12 class CJTBlockTemplatesModel extends CJTHookableClass {
13
14 /**
15 * Check weather a template is linked to specific block.
16 *
17 * Check database block_templates table for record with the given ids.
18 *
19 * @param Integer Block Id.
20 * @param Integer Template Id.
21 * @return boolean TRUE if linked, FALSE if not.
22 */
23 public function isLinked($blockId, $templateId) {
24 // Try to load block template table with the requested Ids.
25 $tableBlockTemplate = CJTxTable::getInstance('block-template');
26 $tableBlockTemplate->set('blockId', $blockId)
27 ->set('templateId', $templateId)
28 ->load(array('blockId', 'templateId'));
29 // Return TRUE if the blockId and the TemplateId returned from the load process!
30 return ($tableBlockTemplate->get('blockId') && $tableBlockTemplate->get('templateId'));
31 }
32
33 } // End class.
34
35 // Hookable!
36 CJTBlockTemplatesModel::define('CJTBlockTemplatesModel');