Code Duplication    Length = 45-46 lines in 3 locations

tests/models/NodeAlMp.php 1 location

@@ 41-85 (lines=45) @@
38
 * @mixin AdjacencyListBehavior
39
 * @mixin MaterializedPathBehavior
40
 */
41
class NodeAlMp extends \yii\db\ActiveRecord
42
{
43
    use AutoTreeTrait;
44
45
    /**
46
     * @inheritdoc
47
     */
48
    public static function tableName()
49
    {
50
        return '{{%tree}}';
51
    }
52
    /**
53
     * @inheritdoc
54
     */
55
    public function behaviors()
56
    {
57
        return [
58
            [
59
                'class'         => AdjacencyListBehavior::className(),
60
                'sortable'      => false,
61
            ],
62
            [
63
                'class'         => MaterializedPathBehavior::className(),
64
            ],
65
        ];
66
    }
67
68
    /**
69
     * @inheritdoc
70
     */
71
    public function transactions()
72
    {
73
        return [
74
            self::SCENARIO_DEFAULT => self::OP_ALL,
75
        ];
76
    }
77
78
    /**
79
     * @return NodeQuery
80
     */
81
    public static function find()
82
    {
83
        return new NodeQuery(get_called_class());
84
    }
85
}

tests/models/NodeAlNi.php 1 location

@@ 41-86 (lines=46) @@
38
 * @mixin AdjacencyListBehavior
39
 * @mixin NestedIntervalsBehavior
40
 */
41
class NodeAlNi extends \yii\db\ActiveRecord
42
{
43
    use AutoTreeTrait;
44
45
    /**
46
     * @inheritdoc
47
     */
48
    public static function tableName()
49
    {
50
        return '{{%tree}}';
51
    }
52
    /**
53
     * @inheritdoc
54
     */
55
    public function behaviors()
56
    {
57
        return [
58
            [
59
                'class'         => AdjacencyListBehavior::className(),
60
                'sortable'      => false,
61
            ],
62
            [
63
                'class'         => NestedIntervalsBehavior::className(),
64
                'treeAttribute' => 'tree',
65
            ],
66
        ];
67
    }
68
69
    /**
70
     * @inheritdoc
71
     */
72
    public function transactions()
73
    {
74
        return [
75
            self::SCENARIO_DEFAULT => self::OP_ALL,
76
        ];
77
    }
78
79
    /**
80
     * @return NodeQuery
81
     */
82
    public static function find()
83
    {
84
        return new NodeQuery(get_called_class());
85
    }
86
}

tests/models/NodeAlNs.php 1 location

@@ 41-86 (lines=46) @@
38
 * @mixin AdjacencyListBehavior
39
 * @mixin NestedSetsBehavior
40
 */
41
class NodeAlNs extends \yii\db\ActiveRecord
42
{
43
    use AutoTreeTrait;
44
45
    /**
46
     * @inheritdoc
47
     */
48
    public static function tableName()
49
    {
50
        return '{{%tree}}';
51
    }
52
    /**
53
     * @inheritdoc
54
     */
55
    public function behaviors()
56
    {
57
        return [
58
            [
59
                'class'         => AdjacencyListBehavior::className(),
60
                'sortable'      => false,
61
            ],
62
            [
63
                'class'         => NestedSetsBehavior::className(),
64
                'treeAttribute' => 'tree',
65
            ],
66
        ];
67
    }
68
69
    /**
70
     * @inheritdoc
71
     */
72
    public function transactions()
73
    {
74
        return [
75
            self::SCENARIO_DEFAULT => self::OP_ALL,
76
        ];
77
    }
78
79
    /**
80
     * @return NodeQuery
81
     */
82
    public static function find()
83
    {
84
        return new NodeQuery(get_called_class());
85
    }
86
}