`$this->sorted || $this->sort();` should do the trick