Several statutes are important to the proper discussion of the question posed.
The TDCJ Ethics Policy ED 02.01 prohibits the conduct described in the government code. It is important to note that the prohibition in this section applies even if the donor is not seeking anything in return. In essence, to accept a gift as a guest the donor must be present. Because each situation is unique and must be examined for the intent of the parties and the potential for undue influence, it is almost impossible to offer a blanket answer to this question. Occasions may arise in which one might accept a social invitation, for instance, and fall within the letter of the law.