Conditions | 3 |
Paths | 2 |
Total Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
38 | public function run( |
||
39 | string $field, |
||
40 | string $element, |
||
41 | string $domain, |
||
42 | int $siteId = null |
||
43 | ) { |
||
44 | |||
45 | $field = $this->resolveField($field); |
||
46 | $element = $this->resolveElement($element); |
||
47 | |||
48 | $query = Domain::find(); |
||
49 | $query->setElement($element) |
||
50 | ->setField($field) |
||
51 | ->setDomain($domain) |
||
52 | ->setSiteId(SiteHelper::ensureSiteId($siteId ?: $element->siteId)); |
||
53 | |||
54 | if (null === ($association = $query->one())) { |
||
55 | return $this->handleSuccessResponse(true); |
||
56 | } |
||
57 | |||
58 | return $this->runInternal($association); |
||
59 | } |
||
60 | |||
72 |