From 02b5497ea50ba7c947c874ecae2074fbaf943a7e Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Tue, 19 Oct 2010 18:49:42 +0200 Subject: [PATCH] closes #20 (rename of key column to name) --- backend/lib/Model/Entity.php | 4 ++-- backend/lib/Model/Property.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/lib/Model/Entity.php b/backend/lib/Model/Entity.php index a475871..37b3b6e 100644 --- a/backend/lib/Model/Entity.php +++ b/backend/lib/Model/Entity.php @@ -67,7 +67,7 @@ abstract class Entity { /** * @OneToMany(targetEntity="Property", mappedBy="entity", cascade={"remove", "persist"}) - * @OrderBy({"key" = "ASC"}) + * @OrderBy({"name" = "ASC"}) */ protected $properties = NULL; @@ -162,7 +162,7 @@ abstract class Entity { if ($property = $this->findProperty($key)) { // property already exists; just change value $property->setValue($value); } - else { // create new property + else { // create new property $property = new Property($this, $key, $value); $this->properties->add($property); } diff --git a/backend/lib/Model/Property.php b/backend/lib/Model/Property.php index 898d352..bc021ed 100644 --- a/backend/lib/Model/Property.php +++ b/backend/lib/Model/Property.php @@ -38,7 +38,7 @@ use Volkszaehler\Model; * @Table( * name="properties", * uniqueConstraints={ - * @UniqueConstraint(name="unique_keys", columns={"entity_id", "`key`"}) + * @UniqueConstraint(name="unique_keys", columns={"entity_id", "name"}) * } * ) * @HasLifecycleCallbacks @@ -53,7 +53,7 @@ class Property { */ protected $id; - /** @Column(name="`key`", type="string", nullable=false) */ + /** @Column(name="name", type="string", nullable=false) */ protected $key; /** @Column(type="string", nullable=false) */