| 1 |
<?php |
| 2 |
/** |
| 3 |
* |
| 4 |
*/ |
| 5 |
|
| 6 |
/** |
| 7 |
* |
| 8 |
*/ |
| 9 |
class CJT_Models_Package_Block { |
| 10 |
|
| 11 |
/** |
| 12 |
* put your comment there... |
| 13 |
* |
| 14 |
* @var mixed |
| 15 |
*/ |
| 16 |
protected $id = null; |
| 17 |
|
| 18 |
/** |
| 19 |
* put your comment there... |
| 20 |
* |
| 21 |
* @param mixed $blockId |
| 22 |
* @return CJT_Models_Package_Block |
| 23 |
*/ |
| 24 |
public function __construct($id) { |
| 25 |
// Initialize. |
| 26 |
$this->id = $id; |
| 27 |
} |
| 28 |
|
| 29 |
/** |
| 30 |
* put your comment there... |
| 31 |
* |
| 32 |
*/ |
| 33 |
public function getPackageInfo() { |
| 34 |
// Initialize. |
| 35 |
$driver = cssJSToolbox::getInstance()->getDBDriver(); |
| 36 |
// Query package info for the current block. |
| 37 |
$query = "SELECT p.id, p.author, p.webSite |
| 38 |
FROM #__cjtoolbox_packages p RIGHT JOIN #__cjtoolbox_package_objects o |
| 39 |
ON p.id = o.packageId AND o.objectType = 'block' |
| 40 |
WHERE o.objectId = {$this->id};"; |
| 41 |
// Exec! |
| 42 |
$packageInfo = $driver->getRow($query, ARRAY_A); |
| 43 |
return $packageInfo; |
| 44 |
} |
| 45 |
|
| 46 |
} // End class. |
| 47 |
|