本文整理汇总了PHP中Vtiger_Relation_Model::deleteRelation方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Relation_Model::deleteRelation方法的具体用法?PHP Vtiger_Relation_Model::deleteRelation怎么用?PHP Vtiger_Relation_Model::deleteRelation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Relation_Model
的用法示例。
在下文中一共展示了Vtiger_Relation_Model::deleteRelation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteRelation
/**
* Function that deletes PriceBooks related records information
* @param <Integer> $sourceRecordId - PriceBook Id
* @param <Integer> $relatedRecordId - Related Record Id
*/
public function deleteRelation($sourceRecordId, $relatedRecordId)
{
$sourceModuleName = $this->getParentModuleModel()->get('name');
$destinationModuleName = $this->getRelationModuleModel()->get('name');
if ($sourceModuleName == 'PriceBooks' && ($destinationModuleName == 'Products' || $destinationModuleName == 'Services')) {
$priceBookModel = Vtiger_Record_Model::getInstanceById($sourceRecordId, $sourceModuleName);
$priceBookModel->deleteListPrice($relatedRecordId);
} else {
parent::deleteRelation($sourceRecordId, $relatedRecordId);
}
}
示例2: deleteRelation
/**
* Function that deletes PriceBooks related records information
* @param <Integer> $sourceRecordId - Product/Service Id
* @param <Integer> $relatedRecordId - Related Record Id
*/
public function deleteRelation($sourceRecordId, $relatedRecordId)
{
$sourceModuleName = $this->getParentModuleModel()->get('name');
$relatedModuleName = $this->getRelationModuleModel()->get('name');
if (($sourceModuleName == 'Products' || $sourceModuleName == 'Services') && $relatedModuleName == 'PriceBooks') {
//Description: deleteListPrice function is deleting the relation between Pricebook and Product/Service
$priceBookModel = Vtiger_Record_Model::getInstanceById($relatedRecordId, $relatedModuleName);
$priceBookModel->deleteListPrice($sourceRecordId);
} else {
if ($sourceModuleName == $relatedModuleName) {
$this->deleteProductToProductRelation($sourceRecordId, $relatedRecordId);
} else {
parent::deleteRelation($sourceRecordId, $relatedRecordId);
}
}
}