Php Order Array Of Objects By Shape