Created
March 31, 2015 08:48
-
-
Save gwin/63b8ec49a53aa664aa9e to your computer and use it in GitHub Desktop.
Check if current user already applied to current job
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Check if current user already applied to $job | |
* | |
* @var $job Wpjb_Model_Job | |
* @return boolean True if current user already applied to $job | |
**/ | |
function my_wpjb_job_already_applied_to(Wpjb_Model_Job $job) { | |
$id = get_current_user_id(); | |
$query = new Daq_Db_Query(); | |
$query->from("Wpjb_Model_Application t"); | |
$query->where("user_id = ?", $id); | |
$query->where("job_id = ?", $job->id); | |
$query->limit(1); | |
$result = $query->execute(); | |
return !empty($result); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment