diff --git a/examples/addCandidateWithFiles.php b/examples/addCandidateWithFiles.php new file mode 100644 index 0000000..4d12709 --- /dev/null +++ b/examples/addCandidateWithFiles.php @@ -0,0 +1,33 @@ +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 = 'candidate@example.com'; + +// 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'); \ No newline at end of file diff --git a/examples/addPosition.php b/examples/addPosition.php new file mode 100644 index 0000000..5f7325b --- /dev/null +++ b/examples/addPosition.php @@ -0,0 +1,32 @@ +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); diff --git a/examples/customCache.php b/examples/customCache.php new file mode 100644 index 0000000..47a5fc9 --- /dev/null +++ b/examples/customCache.php @@ -0,0 +1,21 @@ +signIn($email, $password); + +// Getting current positions +$positions = $breezy->getCompanyPositions($companyId); + +foreach ($positions as $position) { + echo $position->name; +} \ No newline at end of file diff --git a/readme.md b/readme.md index c2a029a..3f8f7bc 100644 --- a/readme.md +++ b/readme.md @@ -8,102 +8,10 @@ Installation using Composer: `composer require briedis/breezy --no-dev` # Usage examples -``` -signIn($email, $password); - - -/* - * Get data about company (description, logo, etc) - */ - -$company = $breezy->getCompany($companyId); -echo $company->name; -echo $company->description; -echo ''; - - -/* - * Getting current positions - */ - -foreach ($breezy->getCompanyPositions($companyId) as $v) { - echo $v->name; -} - - -/* - * Adding a candidate - */ - -// Upload a resume -$resume = $breezy->uploadResume($companyId, '/path/to/resume.pdf', 'my-resume.pdf'); - -// Set candidate data -$candidate = new \Briedis\Breezy\Structures\CandidateItem; -$candidate->name = 'Candidate Name'; -$candidate->phone_number = '1234567890'; -$candidate->email_address = 'candidate@email'; - -// Create the candidate (resume is optional) -$createdCandidate = $breezy->addCandidate($companyId, candidate, $resume); - - -/* - * Adding a position - */ - -$position = new \Briedis\Breezy\Structures\PositionItem; -$position->name = 'Position name'; -$position->description = '

Description

'; -$position->state = \Briedis\Breezy\Structures\PositionItem::STATE_PUBLISHED; - -$breezy->createPosition($companyId, $position); - - -/* - * Implement your own caching class if you want to use the cached driver - */ - -class CustomCacheDriver implements Briedis\Breezy\CacheAdapterInterface -{ - public function get($key) - { - return null; // TODO implement - } - - public function set($key, $value, $durationInSeconds) - { - // TODO implement - } - - public function forget($key) - { - // TODO implement - } -} -``` \ No newline at end of file +* addCandidateWithFiles.php - Add candidate, with resume and other files +* addPosition.php - Add new position +* customCache.php - Implement your own caching class if you want to use the cached driver +* getCurrentPositions.php - Example of getting company positions \ No newline at end of file