Skip to content

Commit

Permalink
Updating changelog, readme for v2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
karllhughes committed Sep 3, 2016
1 parent c220db0 commit 3305cbd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog
All Notable changes to `jobs-common` will be documented in this file

## 2.0.0 - 2016-09-03

### Added
- Readme updates.

## 2.0.0-beta.1 - 2016-09-02

### Fixed
Expand Down
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,39 @@ Gateway | Composer Package | Maintainer

### Build your own providers

New providers can be created by cloning the layout of an existing package. When choosing a name for your package, please don’t use the `JobApis` vendor prefix, as this implies that it is officially supported.
New providers can be created by cloning the layout of an existing package. When choosing a name for your package, please don’t use the `joabpis` vendor prefix, as this implies that it is officially supported.

You should use your own username as the vendor prefix, and prepend `jobs-` to the package name to make it clear that your package works with Jobs Client. For example, if your GitHub username was prometheus, and you were implementing the Dice.com job listing library, a good name for your composer package would be `prometheus/jobs-dice`.
You should use your own username as the vendor prefix, and prepend `jobs-` to the package name to make it clear that your package works with Jobs Common. For example, if your GitHub username were prometheus, and you were implementing the Dice.com job listing API, a good name for your composer package would be `prometheus/jobs-dice`.

#### Implementing your own provider

If you are working with a job board service not supported out-of-the-box or by an existing package, it is quite simple to implement your own. Simply extend `JobApis\Jobs\Client\Providers\AbstractProvider` and implement the required abstract methods:
If you are working with a job board service not supported out-of-the-box or by an existing package, it is quite simple to implement your own. Simply extend `JobApis\Jobs\Client\Providers\AbstractProvider` and `JobApis\Jobs\Client\Queries\AbstractQuery` and implement the required abstract methods in each:

```php
// Documentation coming soon

// JobApis\Jobs\Client\Providers\AbstractProvider

abstract public function createJobObject($payload);

abstract public function getDefaultResponseFields();

abstract public function getListingsPath();


// JobApis\Jobs\Client\Queries\AbstractQuery

abstract public function getBaseUrl();

abstract public function getKeyword();

```

Each of these abstract methods contain a docblock defining their expectations and typical behaviour. Once you have extended this class, you can simply follow the example above using your new `Provider`.
Each of these abstract methods contain a docblock defining their expectations and typical behavior. Once you have extended these classes, you can simply follow the example above using your new `Provider`.

Each job object that is created will automatically set `source` and `query` based on the criteria passed into the provider. If you would like to customize this `source` value, your provider must implement a `getSource` method that returns a string to identify your provider's source.

For an example of each of the concrete classes you'll need to implement, see the `/tests/fixtures` folder in this repository.

#### Make your provider official

If you want to transfer your provider to the `jobapis` GitHub organization and add it to the list of officially supported providers, please open a pull request on the jobapis/jobs-common package. Before new providers will be accepted, they must have 100% unit test code coverage, and follow the conventions and code style used in other Jobs Client providers.
Expand Down

0 comments on commit 3305cbd

Please sign in to comment.