You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							74 lines
						
					
					
						
							1.5 KiB
						
					
					
				
			
		
		
	
	
							74 lines
						
					
					
						
							1.5 KiB
						
					
					
				<?php | 
						|
/** | 
						|
 * @link https://github.com/paulzi/yii2-nested-sets | 
						|
 * @copyright Copyright (c) 2015 PaulZi <pavel.zimakoff@gmail.com> | 
						|
 * @license MIT (https://github.com/paulzi/yii2-nested-sets/blob/master/LICENSE) | 
						|
 */ | 
						|
 | 
						|
namespace paulzi\nestedsets\tests\models; | 
						|
 | 
						|
use paulzi\nestedsets\NestedSetsBehavior; | 
						|
 | 
						|
/** | 
						|
 * @author PaulZi <pavel.zimakoff@gmail.com> | 
						|
 * | 
						|
 * @property integer $id | 
						|
 * @property integer $tree | 
						|
 * @property integer $lft | 
						|
 * @property integer $rgt | 
						|
 * @property integer $depth | 
						|
 * @property string $slug | 
						|
 * | 
						|
 * @property Node[] $parents | 
						|
 * @property Node $parent | 
						|
 * @property Node $root | 
						|
 * @property Node[] $descendants | 
						|
 * @property Node[] $children | 
						|
 * @property Node[] $leaves | 
						|
 * @property Node $prev | 
						|
 * @property Node $next | 
						|
 * | 
						|
 * @method static MultipleTreeNode|null findOne() findOne($condition) | 
						|
 * | 
						|
 * @mixin NestedSetsBehavior | 
						|
 */ | 
						|
class MultipleTreeNode extends \yii\db\ActiveRecord | 
						|
{ | 
						|
    /** | 
						|
     * @inheritdoc | 
						|
     */ | 
						|
    public static function tableName() | 
						|
    { | 
						|
        return '{{%multiple_tree}}'; | 
						|
    } | 
						|
    /** | 
						|
     * @inheritdoc | 
						|
     */ | 
						|
    public function behaviors() | 
						|
    { | 
						|
        return [ | 
						|
            [ | 
						|
                'class' => NestedSetsBehavior::className(), | 
						|
                'treeAttribute' => 'tree', | 
						|
            ], | 
						|
        ]; | 
						|
    } | 
						|
 | 
						|
    /** | 
						|
     * @inheritdoc | 
						|
     */ | 
						|
    public function transactions() | 
						|
    { | 
						|
        return [ | 
						|
            self::SCENARIO_DEFAULT => self::OP_ALL, | 
						|
        ]; | 
						|
    } | 
						|
 | 
						|
    /** | 
						|
     * @return NodeQuery | 
						|
     */ | 
						|
    public static function find() | 
						|
    { | 
						|
        return new NodeQuery(get_called_class()); | 
						|
    } | 
						|
} |