Give_Customer::setup_customer PHP Method

setup_customer() private method

Given the customer data, let's set the variables.
Since: 1.0
private setup_customer ( object $customer ) : boolean
$customer object The Customer Object.
return boolean If the setup was successful or not.
    private function setup_customer($customer)
    {
        if (!is_object($customer)) {
            return false;
        }
        foreach ($customer as $key => $value) {
            switch ($key) {
                case 'notes':
                    $this->{$key} = $this->get_notes();
                    break;
                default:
                    $this->{$key} = $value;
                    break;
            }
        }
        // Customer ID and email are the only things that are necessary, make sure they exist
        if (!empty($this->id) && !empty($this->email)) {
            return true;
        }
        return false;
    }