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

SyncElementFrom   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 2
cbo 2
dl 0
loc 23
ccs 0
cts 11
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 7 1
A defaultDescription() 0 4 1
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