Code Duplication    Length = 7-7 lines in 2 locations

api/src/Storage/Base.php 1 location

@@ 443-449 (lines=7) @@
440
		}
441
		if ($this->timestamps)
442
		{
443
			foreach($this->timestamps as $name)
444
			{
445
				if (isset($data[$name]) && $data[$name])
446
				{
447
					$data[$name] = Api\DateTime::user2server($data[$name],$this->timestamp_type);
448
				}
449
			}
450
		}
451
		return $data;
452
	}

api/src/Contacts.php 1 location

@@ 785-791 (lines=7) @@
782
	function data2db($data, $date_format='ts')
783
	{
784
		// convert timestamps from user-time to server-time in the db
785
		foreach ($this->timestamps as $name)
786
		{
787
			if (isset($data[$name]))
788
			{
789
				$data[$name] = DateTime::user2server($data[$name], $date_format);
790
			}
791
		}
792
		return $data;
793
	}
794