| 1 |
<?php |
| 2 |
/** |
| 3 |
* |
| 4 |
*/ |
| 5 |
|
| 6 |
/** |
| 7 |
* |
| 8 |
*/ |
| 9 |
class CJT_Models_Package_Xml_Definition_PackageHelper { |
| 10 |
|
| 11 |
/** |
| 12 |
* put your comment there... |
| 13 |
* |
| 14 |
* @var mixed |
| 15 |
*/ |
| 16 |
protected $id; |
| 17 |
|
| 18 |
/** |
| 19 |
* put your comment there... |
| 20 |
* |
| 21 |
* @var mixed |
| 22 |
*/ |
| 23 |
protected $name; |
| 24 |
|
| 25 |
/** |
| 26 |
* put your comment there... |
| 27 |
* |
| 28 |
* @param mixed $packageId |
| 29 |
* @return CJT_Models_Package_Xml_Definition_Package_Helper |
| 30 |
*/ |
| 31 |
public function __construct($id) { |
| 32 |
$this->id = $id; |
| 33 |
} |
| 34 |
|
| 35 |
/** |
| 36 |
* put your comment there... |
| 37 |
* |
| 38 |
* @param mixed $objectId |
| 39 |
* @param mixed $objectType |
| 40 |
* @param mixed $relType |
| 41 |
*/ |
| 42 |
public function associateObject($objectId, $objectType, $relType) { |
| 43 |
// Initialize. |
| 44 |
$tblPckObjects = CJTxTable::getInstance('package-objects'); |
| 45 |
// Add Block-Template-Link=>Package reference. |
| 46 |
$tblPckObjects->setData(array( |
| 47 |
'packageId' => $this->getId(), |
| 48 |
'objectId' => $objectId, |
| 49 |
'objectType' => $objectType, |
| 50 |
'relType' => $relType, |
| 51 |
))->save(); |
| 52 |
// Chain. |
| 53 |
return $this; |
| 54 |
} |
| 55 |
|
| 56 |
/** |
| 57 |
* put your comment there... |
| 58 |
* |
| 59 |
*/ |
| 60 |
public function getId() { |
| 61 |
return $this->id; |
| 62 |
} |
| 63 |
|
| 64 |
/** |
| 65 |
* put your comment there... |
| 66 |
* |
| 67 |
*/ |
| 68 |
public function getName() { |
| 69 |
return $this->name; |
| 70 |
} |
| 71 |
|
| 72 |
} // ENd class. |