# css-javascript-toolbox/6.0.6/models/tinymce-blocks.php

CSS &amp; JavaScript Toolbox, version 6.0.6. 42 lines.

- Page: https://pluginprobe.com/plugins/css-javascript-toolbox/6.0.6/code/models/tinymce-blocks.php
- Raw: https://pluginprobe.com/plugins/css-javascript-toolbox/6.0.6/raw/models/tinymce-blocks.php
- Modified: 2013-03-17T20:09:52+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/6.0.6/code/models/tinymce-blocks.php#L10-L20`.

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

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

/**
* 
*/
class CJTTinymceBlocksModel {
	
	/**
	* put your comment there...
	* 
	*/
	public function getItems() {
		// Initializing!
		$driver = cssJSToolbox::getInstance()->getDBDriver();
		// Get common quiery parts!@
		$query = $this->getItemsQuery();
		// Add fields list!
		$query['select'] = 'id, name title, owner';
		$query = "SELECT {$query['select']} FROM {$query['from']} WHERE {$query['where']};";
		// Retrieve blocks!
		return $driver->select($query);
	}
	
	/**
	* put your comment there...
	* 
	*/
	public function getItemsQuery() {
		// Build query parts!
		$query['from'] = '#__cjtoolbox_blocks';
		$query['where'] = 'type = "block" and backupId IS null';
		return $query;
	}
	
} // End class.

```
