getFilename(); if($withHash) { $src .= '?'.md5_file($this->getPath($type)); } return $src; } public function getPath() { return self::getUploadPath().DIRECTORY_SEPARATOR.$this->getFilename(); } public static function getUploadPath() { return sfConfig::get('sf_upload_dir').DIRECTORY_SEPARATOR.self::DIR_NAME; } public function getIconName() { $icons = array('pdf', 'doc', 'xls'); $ext = saCommon::getExtensionFromMime($this->getType()); if($ext == 'docx') { $ext = 'doc'; } if(in_array($ext, $icons)) { return $ext; } return 'file'; } }