public function getByReferral($referralCode)
    {
        if (!is_string($referralCode)) {
            return false;
        }

        $data = [
            'where' => [
                [
                    'column' => $this->tableAlias . '.referral',
                    'value'  => $referralCode,
                ],
            ],
        ];

        $user = $this->getAll(null, null, $data);

        return empty($user) ? false : $user[0];
    }
public function getByReferral($referralCode)
    {
        if (!is_string($referralCode)) {
            return false;
        }

        $data = [
            'where' => [
                [
                    'column' => $this->tableAlias . '.referral',
                    'value'  => $referralCode,
                ],
            ],
        ];

        $user = $this->getAll(null, null, $data);

        return empty($user) ? false : $user[0];
    }
public function getByReferral ( $ referralCode ) { if ( ! is_string ( $ referralCode ) ) { return false ; } $ data = [ 'where' => [ [ 'column' => $ this -> tableAlias . '.referral' , 'value' => $ referralCode , ] , ] , ] ; $ user = $ this -> getAll ( null , null , $ data ) ; return empty ( $ user ) ? false : $ user [ 0 ] ; }
Get a user by their referral code

@param string $referralCode The user's referral code

@return mixed                stdClass on success, false on failure
Get a user by their referral code