public function getByIdentifier($identifier)
    {
        switch (APP_NATIVE_LOGIN_USING) {

            case 'EMAIL':
                $user = $this->getByEmail($identifier);
                break;

            case 'USERNAME':
                $user = $this->getByUsername($identifier);
                break;

            default:
                Factory::helper('email');
                if (valid_email($identifier)) {
                    $user = $this->getByEmail($identifier);
                } else {
                    $user = $this->getByUsername($identifier);
                }
                break;
        }

        return $user;
    }
public function getByIdentifier($identifier)
    {
        switch (APP_NATIVE_LOGIN_USING) {

            case 'EMAIL':
                $user = $this->getByEmail($identifier);
                break;

            case 'USERNAME':
                $user = $this->getByUsername($identifier);
                break;

            default:
                Factory::helper('email');
                if (valid_email($identifier)) {
                    $user = $this->getByEmail($identifier);
                } else {
                    $user = $this->getByUsername($identifier);
                }
                break;
        }

        return $user;
    }
public function getByIdentifier ( $ identifier ) { switch ( APP_NATIVE_LOGIN_USING ) { case 'EMAIL' : $ user = $ this -> getByEmail ( $ identifier ) ; break ; case 'USERNAME' : $ user = $ this -> getByUsername ( $ identifier ) ; break ; default : Factory :: helper ( 'email' ) ; if ( valid_email ( $ identifier ) ) { $ user = $ this -> getByEmail ( $ identifier ) ; } else { $ user = $ this -> getByUsername ( $ identifier ) ; } break ; } return $ user ; }
Look up a user by their identifier

@param string $identifier The user's identifier, either an email address or a username

@return mixed              false on failure, stdClass on success
Look up a user by their identifier