Created
July 9, 2014 20:15
-
-
Save lucasff/c5987f4a426031343c27 to your computer and use it in GitHub Desktop.
afterDelete callback for GradeImagem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Remoção dos arquivos das imagens da grade antes de excluir o registro no banco | |
| * | |
| * @param bool $cascade Parâmetro obrigatório do callback do Model | |
| * | |
| * @return bool | |
| */ | |
| public function afterDelete() | |
| { | |
| foreach ($this->data[$this->alias] as $GradeImg) { | |
| @unlink( | |
| WWW_ROOT . 'uploads/produto_imagem/filename/' . | |
| $GradeImg['filename'] | |
| ); | |
| } | |
| return parent::afterDelete(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment