jobbrander/

jobs-elance

简化了将您的应用程序与Elance API集成的过程。

0.1.0 2015-08-14 14:06 UTC

This package is not auto-updated.

Last update: 2024-09-14 18:17:08 UTC


README

Latest Version Software License Build Status Coverage Status Quality Score Total Downloads

此软件包为JobBrander的Jobs客户端提供Elance Jobs API支持。

此软件包旨在在您从用户那里获取访问令牌后用于与Elance API通信。要验证用户和检索访问令牌,请使用stevenmaguire/oauth2-elance

安装

要安装,请使用composer

composer require jobbrander/jobs-elance

用法

用法与Job Branders的Jobs客户端相同,使用\JobBrander\Jobs\Client\Provider\Elance作为提供者。

$client = new JobBrander\Jobs\Client\Provider\Elance([
    'token' => 'ELANCE ACCESS TOKEN',
]);

$jobs = $client->setKeyword('designer') // A space-delimited list of keywords to search. If omitted, search returns a list of all jobs.
    ->setCategory(1)               // A positive integer representing a category ID that restricts search results to jobs in the specified category. A list of valid category IDs and associated names is available through the categories method. If the value of catFilter does not correspond to an existing category ID, the method returns an empty result set.
    ->setSubCategory(1)            // A positive integer representing a subcategory ID that restricts search results to jobs in the specified subcategory. A list of valid subcategory IDs and associated names is available through the categories method. If the value of subcatFilter does not correspond to an existing category ID, the method returns an empty result set.
    ->setType('startDate')         // The property by which to sort results. Valid values are: budget, numProposals, startDate, endDate
    ->setSort('asc')               // The sort order of the results (ascending or descending). If this value is specified without sortCol, it is ignored. Valid values are: asc, desc; The default is desc.
    ->setPage(2)                   // The requested page of result sets, numbered beginning from 1. Default is 1. If this number exceeds the value of the response property totalPages, the response will contain zero results.
    ->setCount(25)                 // The number of results requested per page. The default is 20. If more than 25 are requested, only 25 results are included in the response.
    ->getJobs();

getJobs方法将返回一个Collection,包含Job对象。

测试

$ ./vendor/bin/phpunit

贡献

请参阅CONTRIBUTING以获取详细信息。

致谢

许可

Apache 2.0。请参阅许可文件以获取更多信息。