startDate ? $this->startDate->format('Y-m-d') : $this->startDate; } /** * Sets start date * * @param \DateTime $startDate * @return $this */ public function setStartDate(\DateTime $startDate = null) { if($startDate == null) $startDate = new \DateTime(); $this->startDate = $startDate; return $this; } /** * Gets end date * * @return \DateTime */ public function getEndDate() { return $this->endDate ? $this->endDate->format('Y-m-d') : $this->endDate; } /** * Sets end date * * @param \DateTime $endDate * @return $this */ public function setEndDate(\DateTime $endDate = null) { $this->endDate = $endDate; return $this; } }