closes #20 (rename of key column to name)
This commit is contained in:
parent
e528214648
commit
02b5497ea5
2 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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) */
|
||||
|
|
Loading…
Add table
Reference in a new issue