Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
FileDuplicateTable.php
1<?php
9
12
30{
31 use Data\Internal\MergeTrait;
32
33 public static function getTableName()
34 {
35 return 'b_file_duplicate';
36 }
37
38 public static function getMap()
39 {
40 return [
41 (new Fields\IntegerField("DUPLICATE_ID"))
42 ->configurePrimary(true),
43
44 (new Fields\IntegerField("ORIGINAL_ID"))
45 ->configurePrimary(true),
46
47 (new Fields\IntegerField("COUNTER"))
48 ->configureDefaultValue(1),
49
50 (new Fields\BooleanField("ORIGINAL_DELETED"))
51 ->configureValues("N", "Y")
52 ->configureDefaultValue("N"),
53 ];
54 }
55
59 public static function markDeleted($originalId)
60 {
61 $originalId = (int)$originalId;
62 $conn = static::getEntity()->getConnection();
63 $table = static::getTableName();
64
65 $conn->query("
66 update {$table}
67 set ORIGINAL_DELETED = 'Y'
68 where ORIGINAL_ID = {$originalId} and ORIGINAL_DELETED = 'N'
69 ");
70
71 static::cleanCache();
72 }
73}