# css-javascript-toolbox/11.2/models/parameters.php

CSS &amp; JavaScript Toolbox, version 11.2. 44 lines.

- Page: https://pluginprobe.com/plugins/css-javascript-toolbox/11.2/code/models/parameters.php
- Raw: https://pluginprobe.com/plugins/css-javascript-toolbox/11.2/raw/models/parameters.php
- Modified: 2020-11-13T10:05:36+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/11.2/code/models/parameters.php#L10-L20`.

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

/**
*
*/
class CJT_Models_Parameters {

	/**
	* Delete parameter or group or parameters
	* or all parameters associasted to specific block.
	*
	* Each Key might has only the parameterId or blockId or both of them.
	*
	* @param array array('blockId' => ID, 'parameterId' => 'ID).
	* @return
	*/
	public function delete($keys) {
		// Initialize.
		$tblParams = CJTxTable::getInstance('parameter')
																					->setTableKey(array('blockId', 'parameterId'));
		// Delete parameters.
		foreach ($keys as $key) {
			// Allow only blockId to be passed as scalar!
			if (!is_array($key)) {
				$key = array($key);
			}
			// Blolckid passed @index 0 while parameters id @index 1
			$key = array(
				'blockId' => $key[0],
				'parameterId' => isset($key[1]) ? $key[1] : null,
			);
			// Delete record.
			$tblParams->setData($key)
													->delete();
		}
		// Chaining.
		return $this;
	}

} // End class.

```
