Completed
Push — develop ( 3644a8...72e19e )
by Nate
06:59
created

SyncElementFrom::defaultDescription()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace flipbox\hubspot\queue\jobs;
4
5
use Craft;
6
use craft\db\Query;
7
use craft\elements\db\ElementQuery;
8
use craft\queue\BaseJob;
9
use flipbox\hubspot\HubSpot;
10
11
class SyncElementFrom extends AbstractSyncElementJob
12
{
13
    /**
14
     * @param \craft\queue\QueueInterface|\yii\queue\Queue $queue
15
     * @return bool|false|string
16
     * @throws \yii\base\InvalidConfigException
17
     */
18
    public function execute($queue)
19
    {
20
        return $this->getResource()->syncDown(
21
            $this->getElement(),
22
            $this->getField()
23
        );
24
    }
25
26
    /**
27
     * @inheritdoc
28
     */
29
    protected function defaultDescription(): string
30
    {
31
        return Craft::t('hubspot', 'Syncing a Craft Element from a HubSpot ' . $this->resource);
32
    }
33
}
34