EPL_Contact Class
| Since | |
|---|---|
3.0.0 |
|
| Methods | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
public
|
__construct(bool $_id_or_email = false)
Get things going
Get things going Parameters
Since
|
# | ||||||||||
public
|
get_contact_email(int $id): mixed
Get the primary email of contact / alias of get_primary_email
Get the primary email of contact / alias of get_primary_email Parameters
Since
|
# | ||||||||||
public
|
update_contact_email(int $id, string $value): bool|int
Update the primary email of contact
Update the primary email of contact Parameters
Since
|
# | ||||||||||
public
|
get_contact_by(string $field = 'id', mixed $value = 0): mixed
Retrieves a single contact from the database
Retrieves a single contact from the database Parameters
ReturnsUpon success, an object of the contact. Upon failure, NULL Since
|
# | ||||||||||
public
|
__get(string $key): mixed|WP_Error
Magic __get function to dispatch a call to retrieve a private property
Magic __get function to dispatch a call to retrieve a private property Parameters
Since
|
# | ||||||||||
public
|
create(array $data = []): mixed
Creates a contact
Creates a contact Parameters
ReturnsFalse if not a valid creation, Contact ID if user is found or valid creation Since
|
# | ||||||||||
public
|
contact_exists(null $email = null): bool|WP_Post
Checking for contact
Checking for contact Parameters
Since
|
# | ||||||||||
public
|
update(array $data = []): bool
Update a contact record
Update a contact record Parameters
ReturnsIf the update was successful or not Since
|
# | ||||||||||
public
|
attach_listing(int $listing_id = 0): bool
Attach listing to the contact then triggers increasing stats
Attach listing to the contact then triggers increasing stats Parameters
ReturnsIf the attachment was successfully Since
|
# | ||||||||||
public
|
remove_listing(integer $listing_id = 0): boolean
Remove a listing from this contact, then triggers reducing stats
Remove a listing from this contact, then triggers reducing stats Parameters
ReturnsIf the removal was successful Since
|
# | ||||||||||
public
|
get_listings()
Get listings of contact
Get listings of contact Since
|
# | ||||||||||
public
|
get_listing_count()
Get listings count
Get listings count Since
|
# | ||||||||||
public
|
get_notes(int $number = 10, int $paged = 1, string $orderby = 'comment_date', string $order = 'DESC'): array
Get the parsed notes for a contact as an array
Get the parsed notes for a contact as an array Parameters
ReturnsThe notes requested Since
|
# | ||||||||||
public
|
get_notes_count(): int
Get the total number of notes we have after parsing
Get the total number of notes we have after parsing ReturnsThe number of notes for the contact. Since
|
# | ||||||||||
public
|
add_note(string $note = '', string $note_type = 'note', int $listing_id = 0): string|boolean
Add a note for the contact
Add a note for the contact Parameters
ReturnsThe new note if added successfully, false otherwise Since
|
# | ||||||||||
public
|
delete()
Delete the contact
Delete the contact Since
|
# | ||||||||||
public
|
update_meta(string $key, string|array $value): bool|int
Update Contact Meta
Update Contact Meta Parameters
Since
|
# | ||||||||||
public
|
get_meta(string $key): mixed
Get Contact Meta
Get Contact Meta Parameters
Since
|
# | ||||||||||
public
|
get_activity_type(string $key): mixed
Returns activity type label for activity type
Returns activity type label for activity type Parameters
Since
|
# | ||||||||||
public
static
|
get_activity_types(): mixed
Returns all activity types
Returns all activity types Since
|
# | ||||||||||
public
|
epl_contact_get_address(): mixed
Returns Contact Address
Returns Contact Address Since
|
# | ||||||||||
public
|
get_primary_email(int $id): mixed
Returns Contact Primary Email
Returns Contact Primary Email Parameters
Since
|
# | ||||||||||
public
|
get_emails(): mixed
Returns Contact Email
Returns Contact Email Since
|
# | ||||||||||
public
|
get_phones(): mixed
Returns Contact Phone
Returns Contact Phone Since
|
# | ||||||||||
public
|
get_category_label(): mixed
Returns Contact Category Label
Returns Contact Category Label Since
|
# | ||||||||||
public
|
get_category_name(): mixed
Returns Contact Category Name
Returns Contact Category Name Since
|
# | ||||||||||
| Properties | |||
|---|---|---|---|
public
|
int
|
$ID = 0
Contact ID.
Contact ID. |
# |
public
|
int
|
$id = 0
Contact ID.
Contact ID. |
# |
public
|
int
|
$listing_count = 0
Contact listing count.
Contact listing count. |
# |
public
|
string
|
$email
Contact email address.
Contact email address. |
# |
public
|
string
|
$name
Contact name.
Contact name. |
# |
public
|
string
|
$date_created
Contact date created.
Contact date created. |
# |
public
|
string
|
$background_info
.
. |
# |
public
|
string
|
$type
.
. |
# |
public
|
string
|
$heading
.
. |
# |
public
|
string
|
$listing_ids
Contact associated listing ids.
Contact associated listing ids. |
# |
public
|
string
|
$notes
notes Contact notes.
notes Contact notes. |
# |