public function getDataForResource() { $this->checkValidity(); if ($this->date) { return $this->date->getTimestamp(); } return null; }