public function getDownloadURL() { if ($this->compressed_file != null) { return $this->compressed_file->getDownloadURL(); } else { return Yii::app()->createURL('OphCoTherapyapplication/Default/DownloadFileCollection', array('id' => $this->id)); } }