@@ 38-51 (lines=14) @@ | ||
35 | * @param $name |
|
36 | * @return StatProject |
|
37 | */ |
|
38 | public function create($name) |
|
39 | { |
|
40 | $name = rawurlencode($name); |
|
41 | ||
42 | $response = $this->performQuery('projects/create', ['name' => $name]); |
|
43 | ||
44 | return new StatProject([ |
|
45 | 'id' => $response['Result']['Id'], |
|
46 | 'name' => $response['Result']['Name'], |
|
47 | 'total_sites' => 0, |
|
48 | 'created_at' => $response['Result']['CreatedAt'], |
|
49 | 'updated_at' => $response['Result']['UpdatedAt'], |
|
50 | ]); |
|
51 | } |
|
52 | ||
53 | /** |
|
54 | * @param $id |
|
@@ 58-70 (lines=13) @@ | ||
55 | * @param $name |
|
56 | * @return StatProject |
|
57 | */ |
|
58 | public function update($id, $name) |
|
59 | { |
|
60 | $name = rawurlencode($name); |
|
61 | ||
62 | $response = $this->performQuery('projects/update', ['id' => $id, 'name' => $name]); |
|
63 | ||
64 | return new StatProject([ |
|
65 | 'id' => $response['Result']['Id'], |
|
66 | 'name' => $response['Result']['Name'], |
|
67 | 'created_at' => $response['Result']['CreatedAt'], |
|
68 | 'updated_at' => $response['Result']['UpdatedAt'], |
|
69 | ]); |
|
70 | } |
|
71 | ||
72 | /** |
|
73 | * @param $id |