Customers
in package
Tags
Table of Contents
- assignAccountOnBooking() : int|null
- convertFromEntity() : Customer
- countCustomers() : mixed
- create() : int|null|WP_Error
- createAccount() : mixed
- createCustomerOnBooking() : int|WP_Error
- customer() : Customer
- delete() : int|false|WP_Error
- deleteFromDb() : int|false
- findBookings() : array<string|int, mixed>
- findBy() : int|Customer
- findByEmail() : int|Customer
- findById() : null|Customer
- findByUserId() : int|Customer
- findCustomers() : mixed
- insert() : int|null
- mapToCustomer() : mixed
- update() : int|null
- updateBookings() : mixed
- updateBookingsByCustomer() : mixed
- updateBookingsByCustomerId() : mixed
- updateData() : int|false|WP_Error
- updateLinkedUser() : int|WP_Error
- validateCustomer() : WP_Error|true
- createCustomerOnFrontend() : int|WP_Error
- createdCustomerFromAdmin() : int
Methods
assignAccountOnBooking()
public
assignAccountOnBooking(int|WP_User $user, string $email, Customer $customer[, mixed $booking = null ]) : int|null
Parameters
- $user : int|WP_User
- $email : string
- $customer : Customer
- $booking : mixed = null
Return values
int|null —convertFromEntity()
public
convertFromEntity(Customer $customer) : Customer
Parameters
- $customer : Customer
Return values
Customer —countCustomers()
public
static countCustomers([mixed $atts = array() ]) : mixed
Parameters
- $atts : mixed = array()
Return values
mixed —create()
public
create(mixed $customer) : int|null|WP_Error
Parameters
- $customer : mixed
Return values
int|null|WP_Error —createAccount()
public
createAccount(string $email, mixed $customer) : mixed
Parameters
- $email : string
- $customer : mixed
Return values
mixed —createCustomerOnBooking()
public
createCustomerOnBooking(Booking $booking[, bool $isAdmin = false ]) : int|WP_Error
Parameters
- $booking : Booking
- $isAdmin : bool = false
-
Is admin booking or not
Tags
Return values
int|WP_Error —customer()
public
customer(array<string|int, mixed> $customerAtts) : Customer
Parameters
- $customerAtts : array<string|int, mixed>
Return values
Customer —delete()
public
static delete(int $customerId) : int|false|WP_Error
Parameters
- $customerId : int
Return values
int|false|WP_Error —deleteFromDb()
public
static deleteFromDb(int $customerId) : int|false
Parameters
- $customerId : int
Return values
int|false —findBookings()
public
static findBookings(int $customerId[, array<string|int, mixed> $atts = [] ][, bool $all = true ]) : array<string|int, mixed>
Parameters
- $customerId : int
- $atts : array<string|int, mixed> = []
- $all : bool = true
Return values
array<string|int, mixed> —findBy()
public
findBy(string $field, int|string $param[, bool $all = true ]) : int|Customer
Parameters
- $field : string
- $param : int|string
- $all : bool = true
Return values
int|Customer —findByEmail()
public
static findByEmail(string $email[, bool $all = true ]) : int|Customer
Parameters
- $email : string
- $all : bool = true
Return values
int|Customer —findById()
public
static findById(int $id) : null|Customer
Parameters
- $id : int
Return values
null|Customer —findByUserId()
public
static findByUserId(int $userId[, bool $all = true ]) : int|Customer
Parameters
- $userId : int
- $all : bool = true
Return values
int|Customer —findCustomers()
public
static findCustomers([mixed $atts = array() ]) : mixed
Parameters
- $atts : mixed = array()
Return values
mixed —insert()
public
static insert(Customer $customer) : int|null
Parameters
- $customer : Customer
Return values
int|null —mapToCustomer()
public
static mapToCustomer(mixed $customer) : mixed
Parameters
- $customer : mixed
Return values
mixed —update()
public
static update(int $customerId, Customer $customer) : int|null
Parameters
- $customerId : int
- $customer : Customer
Return values
int|null —updateBookings()
public
updateBookings(int $customerId) : mixed
Parameters
- $customerId : int
Return values
mixed —updateBookingsByCustomer()
public
static updateBookingsByCustomer(string $customerEmail) : mixed
Parameters
- $customerEmail : string
Return values
mixed —updateBookingsByCustomerId()
public
static updateBookingsByCustomerId(mixed $customerId) : mixed
Parameters
- $customerId : mixed
Return values
mixed —updateData()
public
updateData(mixed $customer) : int|false|WP_Error
Parameters
- $customer : mixed
Return values
int|false|WP_Error —updateLinkedUser()
public
updateLinkedUser(int $userId, Customer $customer) : int|WP_Error
Parameters
- $userId : int
- $customer : Customer
Return values
int|WP_Error —validateCustomer()
public
static validateCustomer(mixed $customer) : WP_Error|true
Parameters
- $customer : mixed
Return values
WP_Error|true —createCustomerOnFrontend()
protected
createCustomerOnFrontend(Customer $bookingCustomer[, mixed $booking = null ]) : int|WP_Error
Parameters
- $bookingCustomer : Customer
- $booking : mixed = null
Return values
int|WP_Error —createdCustomerFromAdmin()
protected
createdCustomerFromAdmin(Customer $bookingCustomer[, mixed $booking = null ]) : int
Parameters
- $bookingCustomer : Customer
- $booking : mixed = null