Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
blockfilter.php
1<?php
3
4
6{
11 public static function checkRow($row)
12 {
13 if (empty($row) || !is_array($row))
14 {
15 return false;
16 }
17 if (empty($row['name']) || !is_string($row['name']))
18 {
19 return false;
20 }
21 if (empty($row['key']) || !is_string($row['key']))
22 {
23 return false;
24 }
25 if (empty($row['value']) || !is_array($row['value']))
26 {
27 return false;
28 }
29 return true;
30 }
31
36 public static function checkPreparedRow($row)
37 {
38 if (empty($row) || !is_array($row))
39 {
40 return false;
41 }
42 if (empty($row['key']) || empty($row['value']) || !is_array($row['value']))
43 {
44 return false;
45 }
46 return true;
47 }
48
55 public static function createRow(string $name, string $key, array $value)
56 {
57 $name = trim($name);
58 $key = trim($key);
59 if ($name === '' || $key === '' || empty($value))
60 {
61 return null;
62 }
63 return [
64 'name' => $name,
65 'key' => $key,
66 'value' => $value
67 ];
68 }
69}
static createRow(string $name, string $key, array $value)