MapConnection.trait.php
772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* Created by PhpStorm.
* User: graymur
* Date: 27.11.13
* Time: 14:45
*/
namespace Cpeople\Traits;
trait MapConnection
{
private $mcLatitude;
private $mcLongtitude;
private function mcFetch()
{
if (!isset($this->mcLatitude))
{
list($this->mcLatitude, $this->mcLongtitude) = preg_split('#\s*,\s*#', $this->getPropValue('COORDINATES'));
}
}
public function getLatitude()
{
$this->mcFetch();
return $this->mcLatitude;
}
public function getLongtitude()
{
$this->mcFetch();
return $this->mcLongtitude;
}
public function getCoordinates()
{
return $this->getPropValue('COORDINATES');
}
}