Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Illuminate\Queue\Jobs;
4
 
5
use Illuminate\Support\InteractsWithTime;
6
 
7
class DatabaseJobRecord
8
{
9
    use InteractsWithTime;
10
 
11
    /**
12
     * The underlying job record.
13
     *
14
     * @var \stdClass
15
     */
16
    protected $record;
17
 
18
    /**
19
     * Create a new job record instance.
20
     *
21
     * @param  \stdClass  $record
22
     * @return void
23
     */
24
    public function __construct($record)
25
    {
26
        $this->record = $record;
27
    }
28
 
29
    /**
30
     * Increment the number of times the job has been attempted.
31
     *
32
     * @return int
33
     */
34
    public function increment()
35
    {
36
        $this->record->attempts++;
37
 
38
        return $this->record->attempts;
39
    }
40
 
41
    /**
42
     * Update the "reserved at" timestamp of the job.
43
     *
44
     * @return int
45
     */
46
    public function touch()
47
    {
48
        $this->record->reserved_at = $this->currentTime();
49
 
50
        return $this->record->reserved_at;
51
    }
52
 
53
    /**
54
     * Dynamically access the underlying job information.
55
     *
56
     * @param  string  $key
57
     * @return mixed
58
     */
59
    public function __get($key)
60
    {
61
        return $this->record->{$key};
62
    }
63
}