/** */ public function updateTimestamps() { if (!isset($this->created)) { $this->created = \Psc\DateTime\DateTime::now(); } $this->modified = \Psc\DateTime\DateTime::now(); return $this; }
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(); }
/** * (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; }
/** * @expectedException InvalidArgumentException */ public function testSetYearBecomesInt() { $date = DateTime::now(); $date->setYear('2011'); }
public function __construct($label) { $this->label = $label; $this->created = \Psc\DateTime\DateTime::now(); $this->articles = new ArrayCollection(); }
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; }