<?php

if (!defined('ROOT')) exit('Can\'t Access !');

class table_question  extends table_mode {
    function delete_before($id = '')
    {
        if($id){
            $this->_question_reply = new questionreply();
            $this->_question_like = new questionlike();
            $questionreply=$this->_question_reply->getrows('aid='.$id, 0, 'adddate desc');
            if (is_array($questionreply))
                foreach ($questionreply as $val){
                        $this->_question_like->rec_delete('rid='.$val['id']);
                        $this->_question_reply->rec_delete('id='.$val['id']);
                }
        }
    }

}