If it appears to the court upon any application for a temporary restraining order, or upon the hearing of any order to show cause why a preliminary injunction should not be issued, or upon the hearing of any motion for a preliminary injunction, or if the court shall find, in any such action, that any defendant therein is violating, or has violated, this chapter, then the court shall enjoin the defendant from doing all acts which are prohibited by the section, or sections, of which any provision thereof is being violated, or has been violated, by the defendant.
Ca. Bus. and Prof'l. Code § 17078