Passed
Pull Request — developer (#16696)
by Arkadiusz
15:40
created

entityAfterSave()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 2
nc 2
nop 1
1
<?php
2
3
/**
4
 *  Update map coordinates handler file.
5
 *
6
 * @package Handler
7
 *
8
 * @copyright YetiForce S.A.
9
 * @license YetiForce Public License 5.0 (licenses/LicenseEN.txt or yetiforce.com)
10
 * @author Arkadiusz Sołek <[email protected]>
11
 */
12
/**
13
 * Update map coordinates handler class.
14
 */
15
class Vtiger_UpdateMapCoordinates_Handler
16
{
17
	/**
18
	 * EntityAfterSave function.
19
	 *
20
	 * @param App\EventHandler $eventHandler
21
	 */
22
	public function entityAfterSave(App\EventHandler $eventHandler)
23
	{
24
		$recordModel = $eventHandler->getRecordModel();
25
		foreach ($recordModel->getModule()->getFieldsByType(['mapCoordinates'], true) as $fieldName => $fieldModel) {
26
			\App\Fields\MapCoordinates::updateMapCoordinates($recordModel, $fieldName);
27
		}
28
	}
29
}
30