Browse Source

Proposition de tag: on garde en base la date de proposition. Pratique pour un jour faire du nottoyage.

bastien 13 years ago
parent
commit
313981f582

+ 2 - 0
src/Muzich/CoreBundle/Controller/ElementController.php View File

@@ -585,6 +585,8 @@ class ElementController extends Controller
585 585
     $proposition = new ElementTagsProposition();
586 586
     $proposition->setElement($element);
587 587
     $proposition->setUser($this->getUser());
588
+    $date = new \DateTime(date('Y-m-d H:i:s'));
589
+    $proposition->setCreated($date);
588 590
     
589 591
     foreach ($tags as $tag)
590 592
     {

+ 26 - 20
src/Muzich/CoreBundle/Entity/ElementTagsProposition.php View File

@@ -52,6 +52,12 @@ class ElementTagsProposition
52 52
    */
53 53
   protected $tags;
54 54
   
55
+  /**
56
+   * @var datetime $created
57
+   *
58
+   * @ORM\Column(type="datetime")
59
+   */
60
+  private $created;
55 61
 //  /**
56 62
 //   * @var datetime $created
57 63
 //   *
@@ -79,26 +85,26 @@ class ElementTagsProposition
79 85
     return $this->id;
80 86
   }
81 87
 
82
-//  /**
83
-//   * Set created
84
-//   *
85
-//   * @param datetime $created
86
-//   */
87
-//  public function setCreated($created)
88
-//  {
89
-//    $this->created = $created;
90
-//  }
91
-//
92
-//  /**
93
-//   * Get created
94
-//   *
95
-//   * @return datetime 
96
-//   */
97
-//  public function getCreated()
98
-//  {
99
-//    return $this->created;
100
-//  }
101
-//
88
+  /**
89
+   * Set created
90
+   *
91
+   * @param datetime $created
92
+   */
93
+  public function setCreated($created)
94
+  {
95
+    $this->created = $created;
96
+  }
97
+
98
+  /**
99
+   * Get created
100
+   *
101
+   * @return datetime 
102
+   */
103
+  public function getCreated()
104
+  {
105
+    return $this->created;
106
+  }
107
+
102 108
 //  /**
103 109
 //   * Set updated
104 110
 //   *