Changeset View
Changeset View
Standalone View
Standalone View
core/units/images/images.php
Show All 17 Lines | |||||
/** | /** | ||||
* Deletes the record from database | * Deletes the record from database | ||||
* | * | ||||
* @param int $id | * @param int $id | ||||
* @return bool | * @return bool | ||||
* @access public | * @access public | ||||
*/ | */ | ||||
public function Delete($id) | public function Delete($id = null) | ||||
Lint: CodingStandard.Commenting.FunctionComment.ScalarTypeHintMissing: Type hint "int" missing for $id | |||||
Public method name "ImagesItem::Delete" is not in camel caps format Lint: CodingStandard.NamingConventions.ValidFunctionName.ScopeNotCamelCaps: Public method name "ImagesItem::Delete" is not in camel caps format | |||||
{ | { | ||||
$this->Load($id); | $this->Load($id); | ||||
$local_path = FULL_PATH . $this->GetDBField('LocalPath'); | $local_path = FULL_PATH . $this->GetDBField('LocalPath'); | ||||
$thumb_path = FULL_PATH . $this->GetDBField('ThumbPath'); | $thumb_path = FULL_PATH . $this->GetDBField('ThumbPath'); | ||||
if ( file_exists($local_path) ) { | if ( file_exists($local_path) ) { | ||||
unlink($local_path); | unlink($local_path); | ||||
} | } | ||||
if ( file_exists($thumb_path) ) { | if ( file_exists($thumb_path) ) { | ||||
unlink($thumb_path); | unlink($thumb_path); | ||||
} | } | ||||
return parent::Delete($id); | return parent::Delete($id); | ||||
} | } | ||||
} | } | ||||
No newline at end of file |
Type hint "int" missing for $id