Skip to content
This repository was archived by the owner on Jul 1, 2025. It is now read-only.

Commit 3c26a39

Browse files
committed
Create company method
1 parent 347e7d8 commit 3c26a39

2 files changed

Lines changed: 45 additions & 0 deletions

File tree

src/Client.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,18 @@ public function project($id)
103103
return new Project($this, $id);
104104
}
105105

106+
/**
107+
* Create a new company
108+
*
109+
* @param Company $company
110+
*
111+
* @return array
112+
*/
113+
public function createCompany($company)
114+
{
115+
return $this->post('companies', $company->toArray());
116+
}
117+
106118
/**
107119
* Override the default Guzzle client
108120
*

src/Company.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
namespace Manavo\DoneDone;
4+
5+
class Company
6+
{
7+
8+
/**
9+
* @var string
10+
*/
11+
private $name = null;
12+
13+
/**
14+
* @param string $name
15+
*/
16+
public function setName($name)
17+
{
18+
$this->name = $name;
19+
}
20+
21+
/**
22+
* @return array
23+
*/
24+
public function toArray()
25+
{
26+
$data = [
27+
'company_name' => $this->name,
28+
];
29+
30+
return $data;
31+
}
32+
33+
}

0 commit comments

Comments
 (0)