mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 22:39:34 +00:00
no message
This commit is contained in:
1 parent
7320e82212
commit
8c79f045fc
6 files changed
+197
-2
No files matched your search
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Karat;
|
||||
|
||||
class Project extends Api {
|
||||
public $code;
|
||||
public $name;
|
||||
public $client;
|
||||
|
||||
public function __construct($code, $name, $client) {
|
||||
$this->code = $code;
|
||||
$this->name = $name;
|
||||
$this->client = $client;
|
||||
}
|
||||
|
||||
public static function all() {
|
||||
$projects = self::getProjects();
|
||||
|
||||
return collect(array_map(function($project) {
|
||||
return new Project( $project['id'], $project['name'], $project['client_id']);
|
||||
}, $projects));
|
||||
}
|
||||
|
||||
public function toArray() {
|
||||
return [
|
||||
'code' => $this->code,
|
||||
'name' => $this->name,
|
||||
'client' => $this->client,
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user