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) */