php-evs / bitrix-learning-orm
该库提供了通过 ORM d7 与学习模块表进行操作的工具
dev-master
2020-05-28 07:22 UTC
Requires
- php: >=7.1
This package is auto-updated.
Last update: 2024-09-20 14:30:06 UTC
README
Bitrix 学习模块的 ORM。
要求
- PHP >= 7.1.0
- Bitrix CMS >= 15.0
namespace \ES\Learning
使用 Composer 安装
在 composer.json 中添加
"php-evs/bitrix-learning-orm": "dev-master" 到 "require" 部分
并且在 "repositories" 部分添加 { "type": "git", "url": "https://github.com/php-evs/bitrix-learning-orm" }
使用示例
按课程活跃日期、课程活跃日期排序获取特定网站的全部课程
\ES\Learning\LessonTable::getList([ 'order' => ['COURSE.ACTIVE_FROM' => 'ASC', 'ACTIVE_FROM' => 'ASC'], 'filter' => [ 'ACTIVE' => 'Y', 'COURSE.SITE.SITE_ID' => SITE_ID, 'CHECK_PERMISSIONS' => 'Y' ], 'select' => [ 'NAME', 'LESSON_ID' => 'ID', 'COURSE_ID' => 'COURSE.ID', 'ACTIVE_FROM' => 'COURSE.ACTIVE_FROM', 'SORT', 'CREATED_BY' ] ])->fetchAll();