Bläddra i källkod

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

bastien 13 år sedan
förälder
incheckning
313981f582

+ 2 - 0
src/Muzich/CoreBundle/Controller/ElementController.php Visa fil

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

+ 26 - 20
src/Muzich/CoreBundle/Entity/ElementTagsProposition.php Visa fil

52
    */
52
    */
53
   protected $tags;
53
   protected $tags;
54
   
54
   
55
+  /**
56
+   * @var datetime $created
57
+   *
58
+   * @ORM\Column(type="datetime")
59
+   */
60
+  private $created;
55
 //  /**
61
 //  /**
56
 //   * @var datetime $created
62
 //   * @var datetime $created
57
 //   *
63
 //   *
79
     return $this->id;
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
 //   * Set updated
109
 //   * Set updated
104
 //   *
110
 //   *