Skip to content

Commit

Permalink
Merge pull request #2 from torque-foxes/feature/ss4
Browse files Browse the repository at this point in the history
SS4 compatibility
  • Loading branch information
andrewandante authored Jul 7, 2021
2 parents cf3ba59 + a1c5f63 commit a0503eb
Show file tree
Hide file tree
Showing 10 changed files with 569 additions and 302 deletions.
5 changes: 5 additions & 0 deletions .upgrade.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mappings:
WorkableTest: SilverStripe\Workable\WorkableTest
Workable: SilverStripe\Workable\Workable
Workable_Result: SilverStripe\Workable\WorkableResult
WorkableRestfulServiceFactory: SilverStripe\Workable\WorkableRestfulServiceFactory
21 changes: 7 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
# Workable for SilverStripe
Adds Workable API integration to SilverStripe projects.
Adds Workable API integration to SilverStripe projects. See https://workable.readme.io/ for API docs.

## Configuration
First, add your API key using a constant, preferably in your `_ss_environment.php` file.
First, add your API key using a constant, preferably in your `.env` file.

```php
define('WORKABLE_API_KEY','your_api_key');
```

Alternatively, you can add your API key in the config, although this is not recommended.

```yaml
Workable:
apiKey: your_api_key
WORKABLE_API_KEY="your_api_key"
```

Then, just add your subdomain to the config.

```
Workable:
```yml
SilverStripe\Workable\Workable:
subdomain: example
```
Expand All @@ -35,15 +28,15 @@ This returns an `ArrayList`, so you can iterate over it on the template.

```html
<% loop $Jobs %>
$Title, $Url
$Title, $Url
<% end_loop %>
```

For nested properties, you can use the dot-separated syntax.

```html
<% loop $Jobs %>
$Title ($Location.City)
$Title ($Location.City)
<% end_loop %>
```

Expand Down
23 changes: 15 additions & 8 deletions _config/config.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
---
Name: workable
---
Workable:
cache_expiry: 3600
Injector:
Workable:
SilverStripe\Core\Injector\Injector:
Psr\SimpleCache\CacheInterface.workable:
factory: SilverStripe\Core\Cache\CacheFactory
constructor:
0: %$WorkableRestfulService
WorkableRestfulService:
class: RestfulService
factory: WorkableRestfulServiceFactory
namespace: 'workable'
defaultLifetime: 3600
SilverStripe\Workable\Workable:
constructor:
0: '%$GuzzleHttp\ClientInterface.workable'
1: '%$Psr\SimpleCache\CacheInterface.workable'
SilverStripe\Workable\WorkableRestfulServiceFactory:
constructor:
apikey: '`WORKABLE_API_KEY`'
GuzzleHttp\ClientInterface.workable:
class: GuzzleHttp\Client
factory: SilverStripe\Workable\WorkableRestfulServiceFactory
Loading

0 comments on commit a0503eb

Please sign in to comment.