* @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $ */ class Bulletin extends BaseBulletin { const SRC_PATH = '/uploads/pdf'; static public function getCommonPath() { return sfConfig::get('sf_upload_dir').DIRECTORY_SEPARATOR.'pdf'.DIRECTORY_SEPARATOR; } public function getSrc($absolute = false) { $src = self::SRC_PATH.'/'.$this->getFilename(); // if($absolute) // { // $src = Shopty::getHostForCulture().$src; // } return $src; } public function getPath() { return self::getCommonPath().$this->getFilename(); } public function isPlanned() { return $this->getIsPlanned(); } public function isSend() { return !is_null($this->getSendDate()); } public function isDeletable() { return !$this->isSend(); } public function hasFile() { return strlen($this->getFilename()) && file_exists($this->getPath()); } public function getNiceFilename() { $info = pathinfo($this->getPath()); return saInflector::urlize($this->getSubject()).(isset($info['extension']) ? '.'.$info['extension'] : null); } public function deleteFiles() { @unlink($this->getPath()); } }