Completed
Push — master ( 11971b...eeafb3 )
by Nate
01:16
created

DeleteRecord::performAction()   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 1
crap 2
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://github.com/flipboxfactory/craft-ember/blob/master/LICENSE
6
 * @link       https://github.com/flipboxfactory/craft-ember/
7
 */
8
9
namespace flipbox\craft\ember\actions\records;
10
11
use yii\base\Action;
12
use yii\db\ActiveRecord;
13
14
/**
15
 * @author Flipbox Factory <[email protected]>
16
 * @since 2.0.0
17
 */
18
abstract class DeleteRecord extends Action
19
{
20
    use DeleteRecordTrait, LookupRecordTrait;
21
22
    /**
23
     * @param ActiveRecord $record
24
     * @return bool
25
     * @throws \Throwable
26
     * @throws \yii\db\StaleObjectException
27
     */
28
    protected function performAction(ActiveRecord $record): bool
29
    {
30
        return $record->delete();
31
    }
32
}
33