Completed
Pull Request — master (#16)
by Gordon
02:18
created

BulkIndexDirtyJob::hyrdate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php declare(strict_types = 1);
2
3
/**
4
 * Created by PhpStorm.
5
 * User: gordon
6
 * Date: 25/3/2561
7
 * Time: 17:01 น.
8
 */
9
10
namespace Suilven\FreeTextSearch\QueuedJob;
11
12
use Suilven\FreeTextSearch\Helper\BulkIndexingHelper;
13
use Symbiote\QueuedJobs\Services\AbstractQueuedJob;
14
15
class BulkIndexDirtyJob extends AbstractQueuedJob
16
{
17
18
    // variable $indexName cannot be declared here, because serialization of the job does not store this variable
19
20
    public function getTitle(): string
21
    {
22
        return 'Bulk Index Dirty DataObjects';
23
    }
24
25
    public function hyrdate($newIndexName)
26
    {
27
        $this->indexName = $newIndexName;
0 ignored issues
show
Bug Best Practice introduced by
The property indexName does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
28
    }
29
30
    public function setup(): void
31
    {
32
        $this->totalSteps = 1;
33
    }
34
35
    public function process(): void
36
    {
37
        $helper = new BulkIndexingHelper();
38
        $helper->bulkIndex($this->indexName, true);
39
40
        $this->isComplete = true;
41
    }
42
}
43