seyfer/kohana-orm-mptt
Composer 安装命令:
composer require seyfer/kohana-orm-mptt
包简介
Kohana 3.3 module - Modified Preorder Tree Traversal library for Kohana ORM
README 文档
README
So far we've only fixed filename for PSR-0, so usage is the same than before
MPTT Library, extends ORM
Setup
Place module in /modules/ and include the call in your bootstrap.
Declaring your ORM object
class Model_Category extends ORM_MPTT {
}
Usage Examples
Creating a root node:
$cat = ORM::factory('Category_Mptt');
$cat->name = 'Music';
$cat->insert_as_new_root();
echo 'Category ID'.$mptt->id.' set at level '.$cat->lvl.' (scope: '.$cat->scope.')';
$c1 = $cat; // Saving id for next example
Creating a child node:
$cat->clear(); // Clearing ORM object
$cat->name = 'Terminology';
$cat->insert_as_last_child($c1);
统计信息
- 总下载量: 17
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2014-12-30