Passed
Push — developer ( 4e3135...f5c82a )
by Radosław
30:25 queued 12:59
created

Settings_MailServers_DeleteAjax_Action   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 8
dl 0
loc 17
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 10 2
1
<?php
2
3
/**
4
 * Delete action file.
5
 *
6
 * @package Settings.Action
7
 *
8
 * @copyright YetiForce S.A.
9
 * @license YetiForce Public License 5.0 (licenses/LicenseEN.txt or yetiforce.com)
10
 * @author Radosław Skrzypczak <[email protected]>
11
 */
12
/**
13
 * Delete action class.
14
 */
15
class Settings_MailServers_DeleteAjax_Action extends Settings_Vtiger_Delete_Action
16
{
17
	/**
18
	 * Function  process.
19
	 *
20
	 * @param \App\Request $request
21
	 */
22
	public function process(App\Request $request)
23
	{
24
		$result = true;
25
		$recordModel = Settings_MailServers_Record_Model::getInstanceById($request->getInteger('record'));
26
		if ($recordModel->getId()) {
27
			$result = (bool) $recordModel->delete();
28
		}
29
		$response = new Vtiger_Response();
30
		$response->setResult(['success' => $result]);
31
		$response->emit();
32
	}
33
}
34