Skip to content

Commit bfac897

Browse files
committed
CertificationTable
1 parent 91aeb59 commit bfac897

15 files changed

+141
-59
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@
66

77
## 0.3 - 2020-02-25
88

9-
* composer.json
9+
* composer.json
10+
11+
## 0.4 - 2020-02-28
12+
13+
* Добавлен класс CertificationTable

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
# bitrix-learning-orm
2-
ORM for bitrix learning module
2+
ORM for bitrix learning module.
33

4-
namespace Learning;
4+
namespace \ES\Learning
55

66
# Examples
77

8-
## 1
9-
Get all Lessons from specific Site sorted by Course active date, Lesson active date
8+
## 1 Get all Lessons from specific Site sorted by Course active date, Lesson active date
109
```php
11-
\Learning\LessonTable::getList([
10+
\ES\Learning\LessonTable::getList([
1211
'order' => ['COURSE.ACTIVE_FROM' => 'ASC', 'ACTIVE_FROM' => 'ASC'],
1312
'filter' => [
1413
'ACTIVE' => 'Y',

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
"description": "Библиотека предоставляет инструменты для работы с таблицами модуля обучения через ORM d7",
44
"keywords": ["bitrix", "битрикс", "orm", "d7", "learning"],
55
"license": "MIT",
6-
"version": "0.3",
6+
"version": "0.4",
77
"support": {
88
"source": "https://github.com/elenasimchenko/bitrix-learning-orm"
99
},
1010
"authors": [
1111
{
1212
"name": "Elena Simchenko",
13-
"email": "m.zhurov@maximaster.ru"
13+
"email": ""
1414
}
1515
],
1616
"require": {
17-
"php": ">=7.0"
17+
"php": ">=7.1"
1818
},
1919
"autoload": {
2020
"psr-4": {

lib/AnswerTable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
namespace Learning;
2+
namespace ES\Learning;
33
use Bitrix\Main\Entity;
44

55
class AnswerTable extends Entity\DataManager
@@ -32,7 +32,7 @@ public static function getMap()
3232
)),
3333
new Entity\ReferenceField(
3434
'QUESTION',
35-
'\Learning\QuestionTable',
35+
'\ES\Learning\QuestionTable',
3636
array('=this.QUESTION_ID' => 'ref.ID'),
3737
array('join_type' => 'LEFT')
3838
),

lib/AttemptTable.php

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?php
2-
namespace Learning;
2+
namespace ES\Learning;
33
use Bitrix\Main\Entity;
44

55
/**
66
*
7-
* \Learning\AttemptTable::getEntity()->compileDbTableStructureDump()
8-
* \Learning\AttemptTable::getEntity()->getFields()
7+
* \ES\Learning\AttemptTable::getEntity()->compileDbTableStructureDump()
8+
* \ES\Learning\AttemptTable::getEntity()->getFields()
99
*
1010
* Class AttemptTable
11-
* @package Learning
11+
* @package ES\Learning
1212
*
1313
*/
1414
class AttemptTable extends Entity\DataManager
@@ -32,12 +32,13 @@ public static function getUfId()
3232
{
3333
return 'LEARN_ATTEMPT';
3434
}
35-
36-
/**
37-
* Returns entity map definition.
38-
*
39-
* @return array
40-
*/
35+
36+
/**
37+
* Returns entity map definition.
38+
*
39+
* @return array
40+
* @throws \Bitrix\Main\ArgumentException
41+
*/
4142
public static function getMap()
4243
{
4344
return array(
@@ -50,7 +51,7 @@ public static function getMap()
5051
)),
5152
new Entity\ReferenceField(
5253
'TEST',
53-
'\Learning\TestTable',
54+
'\ES\Learning\TestTable',
5455
array('=this.TEST_ID' => 'ref.ID'),
5556
array('join_type' => 'LEFT')
5657
),

lib/CertificationTable.php

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?php
2+
namespace ES\Learning;
3+
use Bitrix\Main\Entity;
4+
5+
/**
6+
*
7+
* \ES\Learning\AttemptTable::getEntity()->compileDbTableStructureDump()
8+
* \ES\Learning\AttemptTable::getEntity()->getFields()
9+
*
10+
* Class AttemptTable
11+
* @package ES\Learning
12+
*
13+
*/
14+
15+
class CertificationTable extends Entity\DataManager
16+
{
17+
/**
18+
* Returns DB table name for entity.
19+
*
20+
* @return string
21+
*/
22+
public static function getTableName()
23+
{
24+
return 'b_learn_certification';
25+
}
26+
27+
/**
28+
* Returns entity map definition.
29+
*
30+
* @return array
31+
* @throws \Bitrix\Main\ArgumentException
32+
*/
33+
public static function getMap()
34+
{
35+
return array(
36+
new Entity\IntegerField('ID', array(
37+
'primary' => true,
38+
'autocomplete' => true
39+
)),
40+
new Entity\IntegerField('STUDENT_ID', array(
41+
'required' => true
42+
)),
43+
new Entity\ReferenceField(
44+
'STUDENT',
45+
'Bitrix\Main\UserTable',
46+
array('=this.STUDENT_ID' => 'ref.ID'),
47+
array('join_type' => 'LEFT')
48+
),
49+
new Entity\IntegerField('COURSE_ID', array(
50+
'required' => true
51+
)),
52+
new Entity\ReferenceField(
53+
'COURSE',
54+
'\ES\Learning\CourseTable',
55+
array('=this.COURSE_ID' => 'ref.ID'),
56+
array('join_type' => 'LEFT')
57+
),
58+
new Entity\DateTimeField('TIMESTAMP_X', array(
59+
'required' => true
60+
)),
61+
new Entity\DateTimeField('DATE_CREATE'),
62+
new Entity\IntegerField('SORT'),
63+
new Entity\BooleanField('ACTIVE', array(
64+
'values' => array('N', 'Y')
65+
)),
66+
new Entity\BooleanField('FROM_ONLINE', array(
67+
'values' => array('N', 'Y')
68+
)),
69+
new Entity\BooleanField('PUBLIC_PROFILE', array(
70+
'values' => array('N', 'Y')
71+
)),
72+
new Entity\IntegerField('SUMMARY'),
73+
new Entity\IntegerField('MAX_SUMMARY')
74+
);
75+
}
76+
77+
}

lib/CourseSiteTable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
namespace Learning;
2+
namespace ES\Learning;
33
use Bitrix\Main\Entity;
44

55
class CourseSiteTable extends Entity\DataManager
@@ -28,7 +28,7 @@ public static function getMap()
2828
)),
2929
new Entity\ReferenceField(
3030
'COURSE',
31-
'\Learning\CourseTable',
31+
'\ES\Learning\CourseTable',
3232
array('=this.COURSE_ID' => 'ref.ID'),
3333
array('join_type' => 'LEFT')
3434
),

lib/CourseTable.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?php
2-
namespace Learning;
2+
namespace ES\Learning;
33
use Bitrix\Main\Entity;
44

55
/**
66
*
7-
* \Learning\CourseTable::getEntity()->compileDbTableStructureDump()
8-
* \Learning\CourseTable::getEntity()->getFields()
7+
* \ES\Learning\CourseTable::getEntity()->compileDbTableStructureDump()
8+
* \ES\Learning\CourseTable::getEntity()->getFields()
99
*
1010
* Class CourseTable
11-
* @package Learning
11+
* @package ES\Learning
1212
*
1313
*/
1414
class CourseTable extends Entity\DataManager
@@ -66,13 +66,13 @@ public static function getMap()
6666
'JOURNAL_STATUS' => new Entity\IntegerField('JOURNAL_STATUS'),
6767
'LINKED_LESSON' => new Entity\ReferenceField(
6868
'LINKED_LESSON',
69-
'\Learning\LessonTable',
69+
'\ES\Learning\LessonTable',
7070
array('=this.LINKED_LESSON_ID' => 'ref.ID'),
7171
array('join_type' => 'LEFT')
7272
),
7373
'SITE' => new Entity\ReferenceField(
7474
'SITE',
75-
'\Learning\CourseSiteTable',
75+
'\ES\Learning\CourseSiteTable',
7676
array('=this.ID' => 'ref.COURSE_ID'),
7777
array('join_type' => 'LEFT')
7878
),

lib/GradebookTable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
namespace Learning;
2+
namespace ES\Learning;
33
use Bitrix\Main\Entity;
44

55
class GradebookTable extends Entity\DataManager
@@ -50,7 +50,7 @@ public static function getMap()
5050
)),
5151
new Entity\ReferenceField(
5252
'TEST',
53-
'\Learning\TestTable',
53+
'\ES\Learning\TestTable',
5454
array('=this.TEST_ID' => 'ref.ID'),
5555
array('join_type' => 'LEFT')
5656
),

lib/LessonEdgesTable.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
2-
namespace Learning;
2+
namespace ES\Learning;
33
use Bitrix\Main\Entity;
44

55
/**
66
* Class CourseTable
7-
* @package Learning
7+
* @package ES\Learning
88
*/
99
class LessonEdgesTable extends Entity\DataManager
1010
{
@@ -32,13 +32,13 @@ public static function getMap()
3232
new Entity\IntegerField('SOURCE_NODE', ['primary' => true]),
3333
new Entity\ReferenceField(
3434
'SOURCE',
35-
'\Learning\LessonTable',
35+
'\ES\Learning\LessonTable',
3636
array('=this.SOURCE_NODE' => 'ref.ID')
3737
),
3838
new Entity\IntegerField('TARGET_NODE', ['primary' => true]),
3939
new Entity\ReferenceField(
4040
'TARGET',
41-
'\Learning\LessonTable',
41+
'\ES\Learning\LessonTable',
4242
array('=this.TARGET_NODE' => 'ref.ID')
4343
)
4444
);

0 commit comments

Comments
 (0)