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+ }
0 commit comments