HumanNameParser_Parser::setName PHP Method

setName() public method

Takes Name object or a simple string (converts the string into a Name obj), parses and loads its constituant parts.
public setName ( mixed $name = NULL )
$name mixed Either a name as a string or as a Name object.
    public function setName($name = NULL)
    {
        if ($name) {
            if (is_object($name) && get_class($name) == "HumanNameParser_Name") {
                // this is mostly for testing
                $this->name = $name;
            } else {
                $this->name = new HumanNameParser_Name($name);
            }
            $this->leadingInit = "";
            $this->first = "";
            $this->nicknames = "";
            $this->middle = "";
            $this->last = "";
            $this->suffix = "";
            $this->suffixes = array('esq', 'esquire', 'jr', 'sr', '2', 'ii', 'iii', 'iv');
            $this->prefixes = array('bar', 'ben', 'bin', 'da', 'dal', 'de la', 'de', 'del', 'der', 'di', 'ibn', 'la', 'le', 'san', 'st', 'ste', 'van', 'van der', 'van den', 'vel', 'von');
            $this->parse();
        }
    }