static public function findByEMail($nb_customer, string $email)
    {
        $retval = null;

        if (is_numeric($nb_customer_id = nb_getMixedValue($nb_customer, NABU_CUSTOMER_FIELD_ID))) {
            $retval = CNabuUser::buildObjectFromSQL(
                'select u.* '
                . 'from nb_user u, nb_customer c '
               . 'where u.nb_customer_id=c.nb_customer_id '
                 . 'and c.nb_customer_id=%cust_id$d '
                 . 'and u.nb_user_email=\'%email$s\'',
                array(
                    'cust_id' => $nb_customer_id,
                    'email' => $email
                )
            );
            if ($retval instanceof CNabuUser && $nb_customer instanceof CNabuCustomer) {
                $retval->setCustomer($nb_customer);
            }
        }

        return $retval;
    }
static public function findByEMail($nb_customer, string $email)
    {
        $retval = null;

        if (is_numeric($nb_customer_id = nb_getMixedValue($nb_customer, NABU_CUSTOMER_FIELD_ID))) {
            $retval = CNabuUser::buildObjectFromSQL(
                'select u.* '
                . 'from nb_user u, nb_customer c '
               . 'where u.nb_customer_id=c.nb_customer_id '
                 . 'and c.nb_customer_id=%cust_id$d '
                 . 'and u.nb_user_email=\'%email$s\'',
                array(
                    'cust_id' => $nb_customer_id,
                    'email' => $email
                )
            );
            if ($retval instanceof CNabuUser && $nb_customer instanceof CNabuCustomer) {
                $retval->setCustomer($nb_customer);
            }
        }

        return $retval;
    }
static public function findByEMail ( $ nb_customer , string $ email ) { $ retval = null ; if ( is_numeric ( $ nb_customer_id = nb_getMixedValue ( $ nb_customer , NABU_CUSTOMER_FIELD_ID ) ) ) { $ retval = CNabuUser :: buildObjectFromSQL ( 'select u.* ' . 'from nb_user u, nb_customer c ' . 'where u.nb_customer_id=c.nb_customer_id ' . 'and c.nb_customer_id=%cust_id$d ' . 'and u.nb_user_email=\'%email$s\'' , array ( 'cust_id' => $ nb_customer_id , 'email' => $ email ) ) ; if ( $ retval instanceof CNabuUser && $ nb_customer instanceof CNabuCustomer ) { $ retval -> setCustomer ( $ nb_customer ) ; } } return $ retval ; }
Find a user by email.
@param mixed $nb_customer Customer that owns the User.
@param string $email e-Mail to find.
@return CNabuUser|null Returns a User instance if the email exists or null if not.
Find a user by email .