Example #1
0
 /**
  */
 public function updateTimestamps()
 {
     if (!isset($this->created)) {
         $this->created = \Psc\DateTime\DateTime::now();
     }
     $this->modified = \Psc\DateTime\DateTime::now();
     return $this;
 }
Example #2
0
 public function __construct(Calendar $calendar, $title)
 {
     $this->title = $title;
     $this->calendar = $calendar;
     $this->created = DateTime::now();
     $this->stamp = DateTime::now();
     // Kein plan was der unterschied zu created ist
     $this->modified = DateTime::now();
 }
Example #3
0
 /**
  * (at)ORM\PrePersist
  * (at)ORM\PreUpdate
  */
 public function onPrePersist()
 {
     $this->generateSlugs();
     if (!isset($this->created)) {
         $this->created = \Psc\DateTime\DateTime::now();
     }
     $this->updated = \Psc\DateTime\DateTime::now();
     return $this;
 }
Example #4
0
 /**
  * @expectedException InvalidArgumentException
  */
 public function testSetYearBecomesInt()
 {
     $date = DateTime::now();
     $date->setYear('2011');
 }
Example #5
0
 public function __construct($label)
 {
     $this->label = $label;
     $this->created = \Psc\DateTime\DateTime::now();
     $this->articles = new ArrayCollection();
 }
Example #6
0
 public function updateStatusTimestamp()
 {
     if ($this->status === Status::FINISHED) {
         $this->finishedTime = DateTime::now();
     } elseif ($this->status == Status::DISCOVERED) {
         $this->discoveredTime = DateTime::now();
     } elseif ($this->status == Status::DOWNLOADED) {
         $this->downloadedTime = DateTime::now();
     }
     return $this;
 }