paulzi / yii2-auto-tree Goto Github PK
View Code? Open in Web Editor NEWAllow apply multiple tree behavior for ActiveRecord in Yii2
License: MIT License
Allow apply multiple tree behavior for ActiveRecord in Yii2
License: MIT License
Покажите пример миграции пожалуйста
namespace backend\modules\tree\models;
use Yii;
use paulzi\adjacencylist\AdjacencyListBehavior;
use paulzi\nestedsets\NestedSetsBehavior;
use paulzi\autotree\AutoTreeTrait;
class Tree extends \yii\db\ActiveRecord
{
use AutoTreeTrait;
public function behaviors() {
return [
['class' => AdjacencyListBehavior::className()],
[
'class' => NestedSetsBehavior::className(),
'treeAttribute' => 'tree',
],
];
}
public function transactions()
{
return [
self::SCENARIO_DEFAULT => self::OP_ALL,
];
}
}
**Error
Class 'paulzi\adjacencylist\AdjacencyListBehavior' not found**
An Error occurred while handling another error:
exception 'ReflectionException' with message 'Method yii\db\ActiveQuery::roots() does not exist' in...
I don't know what caused this when I used 'find()->roots()->all()'
There is no changes in this package after adding this parameter in other behaviors, therefore it is lost when using yii2-auto-tree trait
Доброе время суток планируете ли вы реализовать функционал по перемещению "Root nodes" в указанном порядке. То есть у меня есть 3 root узла. Я хочу сам задавать порядок их нахождения друг за другом. Я использую связку AdjacencyListBehavior NestedSetsBehavior. Заранее благодарен.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.