2010-04-03 01:37:15 +04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Doctrine\Tests\Models\Navigation;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Entity
|
|
|
|
* @Table(name="navigation_pois")
|
|
|
|
*/
|
|
|
|
class NavPointOfInterest
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @Id
|
|
|
|
* @Column(type="integer", name="nav_long")
|
|
|
|
*/
|
|
|
|
private $long;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Id
|
|
|
|
* @Column(type="integer", name="nav_lat")
|
|
|
|
*/
|
|
|
|
private $lat;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Column(type="string")
|
|
|
|
*/
|
|
|
|
private $name;
|
|
|
|
|
|
|
|
/**
|
2012-01-15 14:27:28 +04:00
|
|
|
* @ManyToOne(targetEntity="NavCountry", inversedBy="pois")
|
2010-04-03 01:37:15 +04:00
|
|
|
*/
|
|
|
|
private $country;
|
|
|
|
|
2012-07-29 11:27:08 +04:00
|
|
|
/**
|
|
|
|
* @ManyToMany(targetEntity="NavUser", cascade={"persist"})
|
|
|
|
* @JoinTable(name="navigation_pois_visitors",
|
|
|
|
* inverseJoinColumns={@JoinColumn(name="user_id", referencedColumnName="id")},
|
|
|
|
* joinColumns={
|
|
|
|
* @JoinColumn(name="poi_long", referencedColumnName="nav_long"),
|
|
|
|
* @JoinColumn(name="poi_lat", referencedColumnName="nav_lat")
|
|
|
|
* }
|
|
|
|
* )
|
|
|
|
*/
|
|
|
|
private $visitors;
|
|
|
|
|
2010-04-03 01:37:15 +04:00
|
|
|
public function __construct($lat, $long, $name, $country)
|
|
|
|
{
|
|
|
|
$this->lat = $lat;
|
|
|
|
$this->long = $long;
|
|
|
|
$this->name = $name;
|
|
|
|
$this->country = $country;
|
2012-07-29 11:27:08 +04:00
|
|
|
$this->visitors = new \Doctrine\Common\Collections\ArrayCollection;
|
2010-04-03 01:37:15 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getLong() {
|
|
|
|
return $this->long;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getLat() {
|
|
|
|
return $this->lat;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getName() {
|
|
|
|
return $this->name;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getCountry() {
|
|
|
|
return $this->country;
|
|
|
|
}
|
2012-07-29 11:27:08 +04:00
|
|
|
|
|
|
|
public function addVisitor(NavUser $user)
|
|
|
|
{
|
|
|
|
$this->visitors[] = $user;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getVisitors()
|
|
|
|
{
|
|
|
|
return $this->visitors;
|
|
|
|
}
|
2012-01-15 14:27:28 +04:00
|
|
|
}
|