34 lines
649 B
PHP
34 lines
649 B
PHP
<?php
|
|
|
|
/**
|
|
* Subclass for representing a row from the 'app_online_files' table.
|
|
*
|
|
*
|
|
*
|
|
* @package plugins.appOnlineCodesPlugin.lib.model
|
|
*/
|
|
class OnlineFiles extends BaseOnlineFiles
|
|
{
|
|
public function getFileDir()
|
|
{
|
|
return sfConfig::get('sf_data_dir').'/online-files/'.$this->getProductId();
|
|
}
|
|
|
|
public function getFilePath()
|
|
{
|
|
return $this->getFileDir().'/'.$this->getFilename();
|
|
}
|
|
|
|
public function delete($con = null)
|
|
{
|
|
$ret = parent::delete($con);
|
|
|
|
if (is_file($this->getFilePath()))
|
|
{
|
|
unlink($this->getFilePath());
|
|
}
|
|
|
|
return $ret;
|
|
}
|
|
}
|