Skip to content

Commit 2ff666c

Browse files
authored
Create LessonEdgesTable.php
1 parent 1d508f6 commit 2ff666c

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

lib/LessonEdgesTable.php

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
namespace Learning;
3+
use Bitrix\Main\Entity;
4+
5+
/**
6+
* Class CourseTable
7+
* @package Learning
8+
*/
9+
class LessonEdgesTable extends Entity\DataManager
10+
{
11+
/**
12+
* Returns DB table name for entity.
13+
*
14+
* @return string
15+
*/
16+
public static function getTableName()
17+
{
18+
return 'b_learn_lesson_edges';
19+
}
20+
21+
/**
22+
* Returns entity map definition.
23+
*
24+
* @return array
25+
* @throws \Bitrix\Main\ArgumentException
26+
* @throws \Bitrix\Main\ObjectException
27+
*/
28+
public static function getMap()
29+
{
30+
return array(
31+
32+
new Entity\IntegerField('SOURCE_NODE', ['primary' => true]),
33+
new Entity\ReferenceField(
34+
'SOURCE',
35+
'\Learning\LessonTable',
36+
array('=this.SOURCE_NODE' => 'ref.ID')
37+
),
38+
new Entity\IntegerField('TARGET_NODE', ['primary' => true]),
39+
new Entity\ReferenceField(
40+
'TARGET',
41+
'\Learning\LessonTable',
42+
array('=this.TARGET_NODE' => 'ref.ID')
43+
)
44+
);
45+
}
46+
47+
}
48+

0 commit comments

Comments
 (0)