コード例 #1
0
ファイル: Story8.php プロジェクト: elevenone/spark-rest-api
 public function __invoke(array $input)
 {
     $this->stories = new \stories($this->shiftModel, $this->userModel, $this->tokensModel, $this->token);
     if (!empty($input['shiftID'] && !empty($input['employeeID']))) {
         $shiftID = $input['shiftID'];
         $employeeID = $input['shiftID'];
         $success = $this->stories->assignEmployeetoShift($employeeID, $shiftID);
     } else {
         throw new \Exception('improper API usage');
     }
     return (new Payload())->withStatus(Payload::OK)->withOutput(['result' => $success]);
 }