-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added example files
- Loading branch information
Showing
5 changed files
with
116 additions
and
97 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
use \Briedis\Breezy\Breezy; | ||
use \Briedis\Breezy\Structures\CandidateItem; | ||
|
||
// Create a regular breezy class, that does not use caching, always calls API | ||
$breezy = new Breezy(); | ||
|
||
// Set credentials (Company ID can be retrieved from API (http://developer.breezy.hr/docs/userdetails)) | ||
$email = 'your@email'; | ||
$password = '*********'; | ||
$companyId = '000000000'; | ||
$positionId = '000000000'; | ||
|
||
// Sign in before every consecutive request | ||
$breezy->signIn($email, $password); | ||
|
||
// Create candidate | ||
$candidate = new CandidateItem; | ||
$candidate->name = 'John Doe'; | ||
$candidate->origin = CandidateItem::ORIGIN_SOURCED; | ||
$candidate->summary = 'This is a new candidate.'; | ||
$candidate->phone_number = '21234567'; | ||
$candidate->email_address = '[email protected]'; | ||
|
||
// Add candidate | ||
$newCandidate = $breezy->addCandidate($companyId, $positionId, $candidate); | ||
|
||
// Upload candidate resume file | ||
$resume = $breezy->uploadResume($companyId, $positionId, $newCandidate->id, '/path/to/resume.pdf', 'my-resume.pdf'); | ||
|
||
// Upload candidate other documents | ||
$document = $breezy->uploadDocument($companyId, $positionId, $newCandidate->id, '/path/to/document.pdf', 'my-document.pdf'); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
use \Briedis\Breezy\Breezy; | ||
use \Briedis\Breezy\Structures\PositionItem; | ||
|
||
// Create a regular breezy class, that does not use caching, always calls API | ||
$breezy = new Breezy(); | ||
|
||
// Set credentials (Company ID can be retrieved from API (http://developer.breezy.hr/docs/userdetails)) | ||
$email = 'your@email'; | ||
$password = '*********'; | ||
$companyId = '000000000'; | ||
|
||
// Sign in before every consecutive request | ||
$breezy->signIn($email, $password); | ||
|
||
// Create position | ||
$position = new PositionItem; | ||
$position->name = 'Web Developer'; | ||
$position->description = 'This is a developer'; | ||
$position->state = PositionItem::STATE_DRAFT; | ||
$position->location = [ | ||
'country' => 'LV', | ||
'city' => 'Riga', | ||
]; | ||
$position->type = PositionItem::TYPE_OTHER; | ||
$position->category = PositionItem::CATEGORY_OTHER; | ||
$position->education = PositionItem::EDUCATION_UNSPECIFIED; | ||
$position->experience = PositionItem::EXPERIENCE_NA; | ||
|
||
// Add position | ||
$newPosition = $breezy->createPosition($companyId, $position); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
use \Briedis\Breezy\CacheAdapterInterface; | ||
|
||
class CustomCacheDriver implements CacheAdapterInterface | ||
{ | ||
public function get($key) | ||
{ | ||
return null; // TODO implement | ||
} | ||
|
||
public function set($key, $value, $durationInSeconds) | ||
{ | ||
// TODO implement | ||
} | ||
|
||
public function forget($key) | ||
{ | ||
// TODO implement | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
use \Briedis\Breezy\Breezy; | ||
use \Briedis\Breezy\BreezyCached; | ||
|
||
// Create a regular breezy class, that does not use caching, always calls API | ||
$breezy = new Breezy(); | ||
|
||
// To use cached version | ||
$breezy = new BreezyCached(new CustomCacheDriver); | ||
|
||
// Set credentials (Company ID can be retrieved from API (http://developer.breezy.hr/docs/userdetails)) | ||
$email = 'your@email'; | ||
$password = '*********'; | ||
$companyId = '000000000'; | ||
|
||
// Sign in before every consecutive request | ||
$breezy->signIn($email, $password); | ||
|
||
// Getting current positions | ||
$positions = $breezy->getCompanyPositions($companyId); | ||
|
||
foreach ($positions as $position) { | ||
echo $position->name; | ||
} |
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