public static function create(Comment $oComment) { $sQuery = 'insert into comment(product_id,name, user_email,comment,mark,date) values('; $sQuery .= "'{$oComment->getProduct()->getId()}', '{$oComment->getName()}','{$oComment->getUser()->getEmail()}','{$oComment->getComment()}','{$oComment->getMark()}','{$oComment->getDate()}'"; $sQuery .= ')'; $iRetExec = DBOperation::exec($sQuery); if (null !== ($sLastSqlError = DBOperation::getLastSqlError())) { throw new \Exception($sLastSqlError); } }