Add docs for hasId method (Ref symfony/symfony#12331)

Please trim the length of the underline to match the length of the headline.