public function markJobDone($id)
    {
        $entity = $this->get($id);
        $data = ['completed' => true, 'stats' => ['tries' => ($entity->stats['tries'] + 1), 'message' => $entity->stats['message'] . ($entity->stats['tries'] + 1) . '. ' . 'Success!' . PHP_EOL]];
        $this->patchEntity($entity, $data, ['validate' => false]);
        return $this->save($entity);
    }
public function markJobDone($id)
    {
        $entity = $this->get($id);
        $data = ['completed' => true, 'stats' => ['tries' => ($entity->stats['tries'] + 1), 'message' => $entity->stats['message'] . ($entity->stats['tries'] + 1) . '. ' . 'Success!' . PHP_EOL]];
        $this->patchEntity($entity, $data, ['validate' => false]);
        return $this->save($entity);
    }
public function markJobDone ( $ id ) { $ entity = $ this -> get ( $ id ) ; $ data = [ 'completed' => true , 'stats' => [ 'tries' => ( $ entity -> stats [ 'tries' ] + 1 ) , 'message' => $ entity -> stats [ 'message' ] . ( $ entity -> stats [ 'tries' ] + 1 ) . '. ' . 'Success!' . PHP_EOL ] ] ; $ this -> patchEntity ( $ entity , $ data , [ 'validate' => false ] ) ; return $ this -> save ( $ entity ) ; }
Mark job done and add some stats

@param $id
@return bool|\Cake\Datasource\EntityInterface|mixed
Mark job done and add some stats