private function addCommentFile($comment_id, $file) { $ext = pathinfo($file['name'], PATHINFO_EXTENSION); $type = split('/', $file['type']); $type = $type[0]; $data = array('posts_comment_id' => $comment_id, 'file_name' => myTools::generateFileName($ext, $comment_id, null), 'name' => $file['name'], 'type' => $type); $this->PostsCommentsFile->set($data); $this->PostsCommentsFile->save(); }