A restraining order is a court order form that is issued toward an individual, preventing them from getting close to a person. It appears in the episode "Restraining SpongeBob."
Role in episode
Squidward, after getting tired of SpongeBob bothering him at the Krusty Krab, issues him a restraining order. SpongeBob is not allowed to get within 15 feet of Squidward until the restraining order is lifted. Squidward is pleased by this, but SpongeBob has difficulty handing out orders to Squidward due to the restraining order.
However, Mr. Krabs then hires Patrick to take out the orders. Unfortunately for him, Squidward finds Patrick even more annoying than SpongeBob, so at the end of the episode, he changes the restraining order to make it so that Patrick trades places with SpongeBob.