Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
onetomany.php
1<?php
10
15
22class OneToMany extends Relation
23{
25 protected $referenceName;
26
29
30 protected $cascadeDeletePolicy = CascadePolicy::SET_NULL; // follow | no_action | set_null
31
32 public function __construct($name, $referenceEntity, $referenceName)
33 {
34 $this->referenceName = $referenceName;
35
36 if ($referenceEntity instanceof Entity)
37 {
38 $this->refEntity = $referenceEntity;
39 $this->refEntityName = $referenceEntity->getFullName();
40 }
41 else
42 {
43 // this one could be without leading backslash and/or with Table-postfix
44 $this->refEntityName = Entity::normalizeName($referenceEntity);
45 }
46
47 parent::__construct($name);
48 }
49
50 public function getTypeMask()
51 {
53 }
54
55 public function getRefField()
56 {
57 return $this->getRefEntity()->getField($this->referenceName);
58 }
59
63 public function getReferenceName()
64 {
66 }
67}
static normalizeName($entityName)
Definition entity.php:876
__construct($name, $referenceEntity, $referenceName)
Definition onetomany.php:32