forked from Pollenizer/AngelList
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Startup.php
executable file
·81 lines (76 loc) · 1.89 KB
/
Startup.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
/**
* Startup
*
* PHP 5
*
* Licensed under The MIT License
* Redistributions of files must retain the below copyright notice.
*
* @author Robert Love <[email protected]>
* @copyright Copyright 2012, Pollenizer Pty. Ltd. (http://pollenizer.com)
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**
* AngelList
*/
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'AngelList.php';
/**
* Startup
*
* AngelList API / Startups
*
* @link http://angel.co/api/spec/startups
*/
class Startup extends AngelList
{
/**
* Name
*
* @var string
*/
public $name = 'users';
/**
* Batch
*
* Returns up to 50 startups at a time, given an array of ids.
*
* @param array $ids
* @return array $response
* @link http://angel.co/api/spec/startups#GET%2Fstartups%2Fbatch
*/
public function batch($ids = array())
{
$url = $this->endpointUrl . '/' . $this->name . '/batch?ids=' . implode(',', $ids);
return $this->getResponse($url);
}
/**
* Get
*
* Get a startup's information given an id.
*
* @param int $id
* @return array $response
* @link http://angel.co/api/spec/startups#GET%2Fstartups%2F%3Aid
*/
public function get($id = null)
{
$url = $this->endpointUrl . '/' . $this->name . '/' . $id;
return $this->getResponse($url);
}
/**
* Search
*
* Search for a startup given a URL slug. Responds like GET /startups/:id.
*
* @param array $parameters
* @return array $response
* @link http://angel.co/api/spec/startups#GET%2Fstartups%2Fsearch
*/
public function search($parameters = array())
{
$query = http_build_query($parameters);
$url = $this->endpointUrl . '/' . $this->name . '/search?' . $query;
return $this->getResponse($url);
}
}