【文件属性】:
文件名称:yii2-nested-sets:Yii2的嵌套集行为
文件大小:54KB
文件格式:ZIP
更新时间:2021-04-27 13:29:18
PHP
Yii2嵌套集行为
用于将树存储在数据库表中的嵌套集算法的实现。
安装
通过Composer安装:
composer require paulzi/yii2-nested-sets
或添加
" paulzi/yii2-nested-sets " : " ^1.0 "
到composer.json文件的require部分。
迁移示例
警告! depth属性不能被无符号!
单树迁移:
class m150722_150000_single_tree extends Migration
{
public function up ()
{
$ tableOptions = null ;
if ( $ this -> db -> driverName === 'mysql' ) {
// http://stackove
【文件预览】:
yii2-nested-sets-master
----.gitignore(178B)
----NestedSetsBehavior.php(23KB)
----.travis.yml(686B)
----LICENSE(1KB)
----composer.json(886B)
----composer.lock(55KB)
----README.md(8KB)
----tests()
--------.gitignore(22B)
--------data()
--------bootstrap.php(533B)
--------ArrayDataSet.php(1KB)
--------pgsql()
--------models()
--------NestedSetsBehaviorTestCase.php(31KB)
--------NestedSetsQueryTraitTestCase.php(761B)
--------README.md(1KB)
--------sqlite()
--------migrations()
--------mysql()
--------BaseTestCase.php(2KB)
----.scrutinizer.yml(57B)
----phpunit.xml.dist(439B)
----NestedSetsQueryTrait.php(593B)