本文整理汇总了PHP中SugarBean::mark_deleted方法的典型用法代码示例。如果您正苦于以下问题:PHP SugarBean::mark_deleted方法的具体用法?PHP SugarBean::mark_deleted怎么用?PHP SugarBean::mark_deleted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SugarBean
的用法示例。
在下文中一共展示了SugarBean::mark_deleted方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mark_deleted
public function mark_deleted($id)
{
// for now only delete comments, not the products
//$lineItems = $this->getLineItems();
$this->load_relationship('product_bundle_notes');
$lineItems = $this->product_bundle_notes->getBeans();
/* @var $item SugarBean */
foreach ($lineItems as $item) {
$item->mark_deleted($item->id);
}
return parent::mark_deleted($id);
}
示例2: action_remove
/**
* Action Remove
*/
protected function action_remove()
{
$this->view = 'json';
if (!$this->retrieveCurrentBean('Delete')) {
return;
}
if ($this->currentBean->module_dir == "Meetings" || $this->currentBean->module_dir == "Calls") {
if (!empty($_REQUEST['remove_all_recurrences']) && $_REQUEST['remove_all_recurrences']) {
CalendarUtils::markRepeatDeleted($this->currentBean);
}
}
$this->currentBean->mark_deleted($_REQUEST['record']);
$this->view_object_map['jsonData'] = array('access' => 'yes');
}
示例3: mark_deleted
public function mark_deleted($id)
{
// reset caches
$this->clearACLCache();
parent::mark_deleted($id);
}
示例4: mark_deleted
/**
* Checks to see if the user owns this mapping or is an admin first
* If true, then call parent function
*
* @param $id
*/
public function mark_deleted($id)
{
global $current_user;
if (!is_admin($current_user)) {
$other_map = new ImportMap();
$other_map->retrieve_by_string_fields(array('id' => $id), false);
if ($other_map->assigned_user_id != $current_user->id) {
return false;
}
}
return parent::mark_deleted($id);
}
示例5: unlink
/**
* overrides SugarBean's method.
* If a system setting is set, it will mark all related notes as deleted, and attempt to delete files that are
* related to those notes
* @param string id ID
*/
function mark_deleted($id)
{
global $sugar_config;
if ($this->parent_type == 'Emails') {
if (isset($sugar_config['email_default_delete_attachments']) && $sugar_config['email_default_delete_attachments'] == true) {
$removeFile = "upload://{$id}";
if (file_exists($removeFile)) {
if (!unlink($removeFile)) {
$GLOBALS['log']->error("*** Could not unlink() file: [ {$removeFile} ]");
}
}
}
}
// delete note
parent::mark_deleted($id);
}
示例6: mark_deleted
public function mark_deleted($id)
{
require_once("modules/Calendar/CalendarUtils.php");
CalendarUtils::correctRecurrences($this, $id);
parent::mark_deleted($id);
}
示例7:
/**
* Overrides SugarBean's mark_deleted() to drop the related cache table
* @param string $id GUID of I-E instance
*/
function mark_deleted($id)
{
parent::mark_deleted($id);
//bug52021 we need to keep the reference to the folders table in order for emails module to function properly
//$q = "update inbound_email set groupfolder_id = null WHERE id = '{$id}'";
//$r = $this->db->query($q);
$this->deleteCache();
}
示例8:
function mark_deleted($id)
{
$query = "update contacts set campaign_id = null where campaign_id = '{$id}' ";
$this->db->query($query);
$query = "update accounts set campaign_id = null where campaign_id = '{$id}' ";
$this->db->query($query);
// bug49632 - delete campaign logs for the campaign as well
$query = "update campaign_log set deleted = 1 where campaign_id = '{$id}' ";
$this->db->query($query);
return parent::mark_deleted($id);
}
示例9: deleteIfFails
/**
* Provides ability to mark a SugarBean deleted if related file upload failed (and user passed
* the delete_if_fails optional parameter). Note, private to respect "Principle of least privilege"
* If you need in derived classes then you may change to protected.
*
* @param SugarBean $bean Bean
* @param array $args The request args
* @return false if no deletion occured because delete_if_fails was not set otherwise true.
*/
protected function deleteIfFails($bean, $args)
{
// Bug 57210: Need to be able to mark a related record 'deleted=1' when a file uploads fails.
// delete_if_fails flag is an optional query string which can trigger this behavior. An example
// use case might be: user's in a modal and client: 1. POST's related record 2. uploads file...
// If the file was too big, the user may still want to go back and select a smaller file < max;
// but now, upon saving, the client will attempt to PUT related record first and if their ACL's
// may prevent edit/deletes it would fail. This rectifies such a scenario.
if (!empty($args['delete_if_fails'])) {
// First ensure user owns record
if ($bean->created_by == $GLOBALS['current_user']->id) {
$bean->mark_deleted($bean->id);
return true;
}
}
return false;
}
示例10: ReportSchedule
function mark_deleted($id)
{
require_once 'modules/Reports/schedule/ReportSchedule.php';
$report_schedule = new ReportSchedule();
$scheduled_reports = $report_schedule->get_report_schedule($id);
foreach ($scheduled_reports as $rs_row) {
$report_schedule->mark_deleted($rs_row['id']);
}
parent::mark_deleted($id);
}
示例11: mark_deleted
/**
* Delete all the associated Product Bundles from a Quote, This ensures that no orphaned records are left behind,
* when deleting a record.
*
* @param string $id The ID of the record that is being marked as deleted
*/
public function mark_deleted($id)
{
// make sure we have the bean loaded
if ($this->id !== $id) {
$this->retrieve($id);
}
// load up all the product bundles and delete them
$this->load_relationship('product_bundles');
$bundles = $this->product_bundles->getBeans();
/* @var $bundle ProductBundle */
foreach ($bundles as $bundle) {
$bundle->mark_deleted($bundle->id);
}
parent::mark_deleted($id);
}
示例12: mark_deleted
public function mark_deleted($id)
{
if ($this->id != $id) {
$this->retrieve($id);
// does not exist - no need to delete
if (empty($this->id)) {
return;
}
}
remove_logic_hook($this->webhook_target_module, $this->trigger_event, $this->getActionArray());
parent::mark_deleted($id);
}
示例13:
function mark_deleted($id)
{
//remove prospects::prospectLists relationships
$query = "UPDATE prospect_lists_prospects SET deleted = 1 WHERE prospect_list_id = '{$id}' ";
$this->db->query($query);
//remove campaigns::prospectLists relationships
$query = "UPDATE prospect_list_campaigns SET deleted = 1 WHERE prospect_list_id = '{$id}' ";
$this->db->query($query);
return parent::mark_deleted($id);
}
示例14: action_delete
/**
* Perform the actual deletion.
*/
protected function action_delete()
{
//do any pre delete processing
//if there is some custom logic for deletion.
if (!empty($_REQUEST['record'])) {
if (!$this->bean->ACLAccess('Delete')) {
ACLController::displayNoAccess(true);
sugar_cleanup(true);
}
$this->bean->mark_deleted($_REQUEST['record']);
} else {
sugar_die("A record number must be specified to delete");
}
}
示例15: mark_deleted
function mark_deleted($id)
{
$rc = new ReportContainer();
$rc = $rc->retrieve($id);
if ($rc) {
$child_containers = $rc->get_linked_beans("containers", "ReportContainer");
$child_reports = $rc->get_linked_beans("reports", "ZuckerReport");
foreach ($child_containers as $c) {
$c->parent_id = $rc->parent_id;
$c->save();
}
foreach ($child_reports as $r) {
$r->container_id = $rc->parent_id;
$r->save();
}
}
SugarBean::mark_deleted($id);
}