Completed
Push — master ( 8529d8...298250 )
by Pavel
06:44
created

tests/models/Node.php (1 issue)

Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * @link https://github.com/paulzi/yii2-nested-intervals
4
 * @copyright Copyright (c) 2015 PaulZi <[email protected]>
5
 * @license MIT (https://github.com/paulzi/yii2-nested-intervals/blob/master/LICENSE)
6
 */
7
8
namespace paulzi\nestedintervals\tests\models;
9
10
use paulzi\nestedintervals\NestedIntervalsBehavior;
11
12
/**
13
 * @author PaulZi <[email protected]>
14
 *
15
 * @property integer $id
16
 * @property integer $lft
17
 * @property integer $rgt
18
 * @property integer $depth
19
 * @property string $slug
20
 *
21
 * @property Node[] $parents
22
 * @property Node $parent
23
 * @property Node $root
24
 * @property Node[] $descendants
25
 * @property Node[] $children
26
 * @property Node[] $leaves
27
 * @property Node $prev
28
 * @property Node $next
29
 *
30
 * @method static Node|null findOne() findOne($condition)
31
 *
32
 * @mixin NestedIntervalsBehavior
33
 */
34 View Code Duplication
class Node extends \yii\db\ActiveRecord
35
{
36
    /**
37
     * @inheritdoc
38
     */
39 210
    public static function tableName()
40
    {
41 210
        return '{{%tree}}';
42
    }
43
    /**
44
     * @inheritdoc
45
     */
46 210
    public function behaviors()
47
    {
48
        return [
49
            'tree' => [
50 210
                'class' => NestedIntervalsBehavior::className(),
0 ignored issues
show
Deprecated Code introduced by
The method yii\base\BaseObject::className() has been deprecated with message: since 2.0.14. On PHP >=5.5, use `::class` instead.

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
51
            ],
52
        ];
53
    }
54
55
    /**
56
     * @inheritdoc
57
     */
58 168
    public function transactions()
59
    {
60
        return [
61 168
            self::SCENARIO_DEFAULT => self::OP_ALL,
62
        ];
63
    }
64
65
    /**
66
     * @return NodeQuery
67
     */
68 198
    public static function find()
69
    {
70 198
        return new NodeQuery(get_called_class());
71
    }
72
}