Wpjb_Model_Resume class reference
Resume Object is the object you will be using in resumes module most often, it contains information about particular resume and provides interface to access related information..
The Job Object class is Wpjb_Model_Resume, the class file is at wpjobboard/application/libraries/Model/Resume.php
Public properties
-
id
(int) The Resume id -
user_id
(int) Id of a user (in wp_users table) who owns the resume -
phone
(string) The user phone number -
headline
(string) One sentence resume description (for example “Senior PHP Developer”) -
description
(string) Resume summary -
created_at
(string) The date when resume was posted, in format “YYYY-MM-DD” -
modified_at
(string) The date when resume was last modified, in format “YYYY-MM-DD” -
candidate_country
(int) Country ISO 3166-1 Numeric code -
candidate_state
(string) The Resume owner state (as a state inside a country) -
candidate_zip_code
(string) The Resume owner zip code -
candidate_location
(string) The Resume owner city/location -
is_public
(int) Either 0 or 1, only resumes with is_public equal to 1 are displayed in the frontend -
is_active
(int) Either 0 or 1, this is a job state (active or inactive) set by administrator -
tag
(object) Object containig information about categories (usage below) -
meta
(object) Object containing information about fields added using Custom Fields (usage below) - user
(object) WP_User object containing login data of user who owns the resume
Public Methods
current()
Static method, returns Wpjb_Model_Resume object with info about currently logged in user or NULL if user is not logged in or is logged as an Employer
Parameters None
Returns mixed (Wpjb_Model_Resume or NULL)
delete()
Deletes Resume from database along with all job files and meta data.
Parameters None
Returns NULL
getAvatarUrl()
Returns absolute URL (starting with http://) to uploaded resume profile image.
Parameters None
Returns mixed (String or NULL if image was not uploaded)
getEducation()
Returns all user education entries (see usage below)
Parameters None
Returns Array (of Wpjb_Model_ResumeDetail objects)
getExperience()
Returns all user experience entries (see usage below)
Parameters None
Returns Array (of Wpjb_Model_ResumeDetail objects)
getGeo()
Returns resume geo location parameters (used by Google Maps) as an stdClass object. The object has following properties: geo_status, geo_latitude, geo_longitude, lnglat
Parameters None
Returns stdClass
locationToString()
Returns address formatted using resume: country, state, zip code and location information
Parameters None
Returns string
save()
Saves (inserts or updates) Resume in database.
Parameters None
Returns (int) Job unique ID
url()
Returns absolute Resume URL (works only for jobs that are saved in DB)
Parameters None
Returns (string) Absolute Job URL (starting with http://)
Usage Examples
Loading resume saved in database and displaying its headline and url
$resume = new Wpjb_Model_Resume(5); echo $resume->headline . "<br/>"; echo $resume->url();
Loading resume saved in database, changing title and saving changes in DB
$resume = new Wpjb_Model_Resume(15); $resume->headline = "Headline updated!"; $resume->save();
Using tags to display categories
$resume = new Wpjb_Model_Resume(7); // check if resume is assigned go any categories if(!empty($resume->tag->category)) { foreach($resume->tag->category as $item) { echo $item->title . " - " . $item->url() . "<br/>"; } }
Using meta values to display resume experience and education information
$resume = new Wpjb_Model_Resume(9); foreach($resume->getExperience() as $detail) { echo "Grantor: " . $detail->grantor . "<br/>"; echo "Title: " . $detail->detail_title . "<br/>"; echo "Started: " . $detail->started_at . "<br/>"; echo "Finished: " . $detail->completed_at . "<br/>"; echo $detail->detail_description . "<br/><br/>"; } foreach($resume->getEducation() as $detail) { // you can use here the same code as in foreach loop above }
Returning data from wp_users table
$resume = new Wpjb_Model_Resume(9); echo $resume->user->user_email . "<br/>"; echo $resume->user->first_name . "<br/>";