|
Shop_Customer class
Represents a customer.
Public propertiesShow inherited properties.
Public methodsShow inherited methods.
Events
Property details¶ billing_city propertypublic string $billing_city;
Specifies the customer billing city.
¶ billing_country propertypublic Shop_Country $billing_country;
Specifies a billing country.
¶ billing_state propertypublic Shop_CountryState $billing_state;
Specifies a billing state.
¶ billing_street_addr propertypublic string $billing_street_addr;
Specifies the customer billing street address.
¶ billing_zip propertypublic string $billing_zip;
Specifies the customer billing ZIP/postal code.
¶ company propertypublic string $company;
Specifies the customer company name.
¶ created_at propertypublic Phpr_DateTime $created_at;
Specifies the date and time when the customer record was created.
¶ email propertypublic string $email;
Specifies the customer email.
¶ first_name propertypublic string $first_name;
Specifies the customer first name.
¶ group propertypublic Shop_CustomerGroup $group;
A reference to a customer group the customer belongs to.
¶ guest propertypublic boolean $guest;
Indicates whether the customer is a guest.
¶ id propertypublic integer $id;
Specifies the customer record identifier.
¶ image propertypublic Db_DataCollection $image;
The customer photo. The collection contains zero or one object of Db_File class.
¶ last_name propertypublic string $last_name;
Specifies the customer last name.
¶ notes propertypublic string $notes;
Specifies the customer notes.
¶ orders propertypublic Db_DataCollection $orders;
A list of customer orders. Each element of the collection is an object of the Shop_Order class.
¶ phone propertypublic string $phone;
Specifies the customer phone number.
¶ shipping_city propertypublic string $shipping_city;
Specifies the customer shipping city.
¶ shipping_company propertypublic string $shipping_company;
Specifies the shipping company name.
¶ shipping_country propertypublic Shop_Country $shipping_country;
Specifies a shipping country.
¶ shipping_first_name propertypublic string $shipping_first_name;
Specifies the shipping first name.
¶ shipping_last_name propertypublic string $shipping_last_name;
Specifies the shipping last name.
¶ shipping_phone propertypublic string $shipping_phone;
Specifies the shipping phone number.
¶ shipping_state propertypublic Shop_CountryState $shipping_state;
Specifies a shipping state.
¶ shipping_street_addr propertypublic string $shipping_street_addr;
Specifies the customer shipping street address.
¶ shipping_zip propertypublic string $shipping_zip;
Specifies the customer shipping ZIP/postal code.
¶ updated_at propertypublic Phpr_DateTime $updated_at;
Specifies the date and time when the customer record was updated last time.
Method details¶ copy_from_order() methodpublic void copy_from_order(Shop_Order $order)
Copies the customer name and address information from an order object.
The method doesn't save the customer object.
¶ copy_to_order() methodpublic void copy_to_order(Shop_Order $order)
Copies the customer name and address information to an order object.
The method doesn't save the order object.
¶ delete_customer() methodpublic void delete_customer()
Deletes a customer from the database or marks the customer as deleted.
If a customer has any orders associated, it cannot be deleted permanently.
The method marks such customers as deleted. Deleted customers can be restored
with restore_customer() method.
¶ find_registered_by_email() methodpublic static Shop_Customer find_registered_by_email(string $email)
Finds a registered customer by its email address.
¶ reset_password() methodpublic static void reset_password(string $email)
Finds a registered customer by email and resets their password.
The method sends the shop:password_reset notification to customer.
If the customer is not found, an application exception is thrown.
¶ restore_customer() methodpublic void restore_customer()
Restores a customer previously deleted with delete_customer() method.
¶ send_password_restore() methodpublic static void send_password_restore(string $email)
Finds a registered customer by email and sends a password restore email.
The method sends the shop:password_restore notification to customer.
If the customer is not found, an application exception is thrown.
|