protected function getChoiceByUsernameOrEmail($selection)
    {
        foreach ($this->choices as $item) {
            if ($item->getUsername() === $selection) {
                return $item;
            }
            if ($item->getEmail() === $selection) {
                return $item;
            }
        }

        return;
    }
protected function getChoiceByUsernameOrEmail($selection)
    {
        foreach ($this->choices as $item) {
            if ($item->getUsername() === $selection) {
                return $item;
            }
            if ($item->getEmail() === $selection) {
                return $item;
            }
        }

        return;
    }
protected function getChoiceByUsernameOrEmail ( $ selection ) { foreach ( $ this -> choices as $ item ) { if ( $ item -> getUsername ( ) === $ selection ) { return $ item ; } if ( $ item -> getEmail ( ) === $ selection ) { return $ item ; } } return ; }
Find User by username or email

@param string $username

@return User
Find User by username or email