public function getLastModified() { $time = 0; foreach ($this->photos as $photo) { $time = max($photo->upload_date->getTimestamp(), $time); } if ($time == 0) { $date = new SwatDate(); $time = $date->getTimestamp(); } return $time; }