In any action arising out of the provisions of this chapter, the prevailing party shall be entitled to reasonable attorney’s fees and costs. A party shall be deemed a prevailing party for the purposes of this section if the judgment is rendered in his or her favor or where the litigation is dismissed in his or her favor prior to or during the trial, unless the parties otherwise agree in the settlement or compromise.