Add the model stuff to the location.

This commit is contained in:
Tim Schumacher 2014-09-24 23:25:19 +02:00
parent 73400e90fd
commit 1b3fc58d44

View file

@ -8,8 +8,13 @@ use Doctrine\ORM\Mapping as ORM;
* Location
*
* @property string $name
* @property string $description
* @property float $lon
* @property float $lat
* @property string $streetaddress
* @property string $streetnumber
* @property string $zipcode;
* @property string $city
*
* @ORM\Table(name="locations")
* @ORM\Entity
@ -23,6 +28,41 @@ class Location extends BaseEntity
*/
protected $name;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=true)
*/
protected $description;
/**
* @var string
*
* @ORM\Column(name="streetaddress", type="string", length=255, nullable=true)
*/
protected $streetaddress;
/**
* @var string
*
* @ORM\Column(name="streetnumber", type="string", length=255, nullable=true)
*/
protected $streetnumber;
/**
* @var string
*
* @ORM\Column(name="zipcode", type="string", length=255, nullable=true)
*/
protected $zipcode;
/**
* @var string
*
* @ORM\Column(name="city", type="string", length=255, nullable=true)
*/
protected $city;
/**
* @var float
*
@ -37,5 +77,9 @@ class Location extends BaseEntity
*/
protected $lat;
public function hasAddress() {
return ((strlen($this->streetaddress) > 0) && (strlen($this->city)));
}
}