From 1b3fc58d441aae194129ee7d07a6c7b22aed9a73 Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Wed, 24 Sep 2014 23:25:19 +0200 Subject: [PATCH] Add the model stuff to the location. --- .../Bundle/CalciferBundle/Entity/Location.php | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/src/Hackspace/Bundle/CalciferBundle/Entity/Location.php b/src/Hackspace/Bundle/CalciferBundle/Entity/Location.php index afd6feb..477d42f 100755 --- a/src/Hackspace/Bundle/CalciferBundle/Entity/Location.php +++ b/src/Hackspace/Bundle/CalciferBundle/Entity/Location.php @@ -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))); + } + }