Files
jandl-taskmanager-app/be/app/Services/Karat/Project.php
T
2023-03-03 14:22:39 +01:00

33 lines
708 B
PHP

<?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,
];
}
}