public function getFirstMatchingField ($selector)
    {
        $fields = $this->getFields($selector);
        if (empty($fields)) {
            return null;
        } else {
            return reset($fields);
        }
    }
public function getFirstMatchingField ($selector)
    {
        $fields = $this->getFields($selector);
        if (empty($fields)) {
            return null;
        } else {
            return reset($fields);
        }
    }
public function getFirstMatchingField ( $ selector ) { $ fields = $ this -> getFields ( $ selector ) ; if ( empty ( $ fields ) ) { return null ; } else { return reset ( $ fields ) ; } }
Return the first field that matches a selector.

@param  string $selector Body of regular expression
@return Field|null The first matching field or NULL if no match
Return the first field that matches a selector .