1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
blog_post_category.php
См. документацию.
1
<?php
2
3
IncludeModuleLangFile
(__FILE__);
4
5
class
CAllBlogPostCategory
6
{
7
/*************** ADD, UPDATE, DELETE *****************/
8
public
static
function
CheckFields
(
$ACTION
, &
$arFields
,
$ID
= 0)
9
{
10
global
$APPLICATION
;
11
12
if
((
is_set
(
$arFields
,
"POST_ID"
) ||
$ACTION
==
"ADD"
) &&
$arFields
[
"POST_ID"
] ==
''
)
13
{
14
$APPLICATION
->ThrowException(
GetMessage
(
"BLG_GCT_EMPTY_POST_ID"
),
"EMPTY_POST_ID"
);
15
return
false
;
16
}
17
elseif
(
is_set
(
$arFields
,
"POST_ID"
))
18
{
19
$arResult
=
CBlogPost::GetByID
(
$arFields
[
"POST_ID"
]);
20
if
(!
$arResult
)
21
{
22
$APPLICATION
->ThrowException(str_replace(
"#ID#"
,
$arFields
[
"POST_ID"
],
GetMessage
(
"BLG_GCT_ERROR_NO_POST"
)),
"ERROR_NO_POST"
);
23
return
false
;
24
}
25
}
26
27
if
((
is_set
(
$arFields
,
"BLOG_ID"
) ||
$ACTION
==
"ADD"
) && intval(
$arFields
[
"BLOG_ID"
]) <= 0)
28
{
29
$APPLICATION
->ThrowException(
GetMessage
(
"BLG_GCT_EMPTY_BLOG_ID"
),
"EMPTY_BLOG_ID"
);
30
return
false
;
31
}
32
elseif
(
is_set
(
$arFields
,
"BLOG_ID"
))
33
{
34
$arResult
=
CBlog::GetByID
(
$arFields
[
"BLOG_ID"
]);
35
if
(!
$arResult
)
36
{
37
$APPLICATION
->ThrowException(str_replace(
"#ID#"
,
$arFields
[
"BLOG_ID"
],
GetMessage
(
"BLG_GCT_ERROR_NO_BLOG"
)),
"ERROR_NO_BLOG"
);
38
return
false
;
39
}
40
}
41
42
if
((
is_set
(
$arFields
,
"CATEGORY_ID"
) ||
$ACTION
==
"ADD"
) && intval(
$arFields
[
"CATEGORY_ID"
]) <= 0)
43
{
44
$APPLICATION
->ThrowException(
GetMessage
(
"BLG_GCT_EMPTY_CATEGORY_ID"
),
"EMPTY_CATEGORY_ID"
);
45
return
false
;
46
}
47
elseif
(
is_set
(
$arFields
,
"CATEGORY_ID"
))
48
{
49
$arResult
=
CBlogCategory::GetByID
(
$arFields
[
"CATEGORY_ID"
]);
50
if
(!
$arResult
)
51
{
52
$APPLICATION
->ThrowException(str_replace(
"#ID#"
,
$arFields
[
"CATEGORY_ID"
],
GetMessage
(
"BLG_GCT_ERROR_NO_CATEGORY"
)),
"ERROR_NO_CATEGORY"
);
53
return
false
;
54
}
55
}
56
57
return
true
;
58
}
59
60
public
static
function
Delete
(
$ID
)
61
{
62
global
$DB
;
63
64
$ID
= intval(
$ID
);
65
66
return
$DB
->Query(
"DELETE FROM b_blog_post_category WHERE ID = "
.
$ID
.
""
,
true
);
67
}
68
69
//*************** SELECT *********************/
70
public
static
function
GetByID
(
$ID
)
71
{
72
global
$DB
;
73
74
$ID
= intval(
$ID
);
75
76
$strSql =
77
"SELECT C.ID, C.BLOG_ID, C.POST_ID, C.CATEGORY_ID "
.
78
"FROM b_blog_post_category C "
.
79
"WHERE C.ID = "
.$ID.
""
;
80
$dbResult
=
$DB
->Query($strSql);
81
if
(
$arResult
=
$dbResult
->Fetch())
82
{
83
return
$arResult
;
84
}
85
return
False;
86
}
87
88
public
static
function
DeleteByPostID
(
$ID
)
89
{
90
global
$DB
;
91
92
$ID
= intval(
$ID
);
93
94
return
$DB
->Query(
"DELETE FROM b_blog_post_category WHERE POST_ID = "
.
$ID
.
""
,
true
);
95
}
96
}
$APPLICATION
global $APPLICATION
Определения
include.php:80
$arResult
$arResult
Определения
generate_coupon.php:16
CAllBlogCategory\GetByID
static GetByID($ID)
Определения
blog_category.php:82
CAllBlog\GetByID
static GetByID($ID)
Определения
blog.php:931
CAllBlogPostCategory
Определения
blog_post_category.php:6
CAllBlogPostCategory\Delete
static Delete($ID)
Определения
blog_post_category.php:60
CAllBlogPostCategory\GetByID
static GetByID($ID)
Определения
blog_post_category.php:70
CAllBlogPostCategory\DeleteByPostID
static DeleteByPostID($ID)
Определения
blog_post_category.php:88
CAllBlogPostCategory\CheckFields
static CheckFields($ACTION, &$arFields, $ID=0)
Определения
blog_post_category.php:8
CBlogPost\GetByID
static GetByID($ID)
Определения
blog_post.php:511
$arFields
$arFields
Определения
dblapprove.php:5
$ID
if($ajaxMode) $ID
Определения
get_user.php:27
$DB
global $DB
Определения
cron_frame.php:29
$ACTION
$ACTION
Определения
csv_new_setup.php:27
IncludeModuleLangFile
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
Определения
tools.php:3778
is_set
is_set($a, $k=false)
Определения
tools.php:2133
GetMessage
GetMessage($name, $aReplace=null)
Определения
tools.php:3397
elseif
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения
prolog_main_admin.php:393
$dbResult
$dbResult
Определения
updtr957.php:3
bitrix
modules
blog
general
blog_post_category.php
Создано системой
1.14.0