PluginProbe
QuadMenu – Mega Menu / 3.3.7
QuadMenu – Mega Menu v3.3.7
3.3.8 3.3.7 3.3.6 trunk 1.8.4 1.8.5 1.8.7 1.8.8 1.8.9 1.9.0 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 88 releases
quadmenu / vendor / franmastromarino / wp-orm / tests / Single / SingleEntityTest.php

SingleEntityTest.php in QuadMenu – Mega Menu 3.3.7, at vendor/franmastromarino/wp-orm/tests/Single/SingleEntityTest.php

39 lines 901 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace QuadLayers\WP_Orm\Tests\Single;
4
5 class SingleEntityTest extends \QuadLayers\WP_Orm\Entity\SingleEntity
6 {
7 public static $sanitizeProperties = [
8 'key1' => 'strval',
9 'key2' => 'strval',
10 'key3' => self::class . '::sanitizeKey3',
11 'key4' => 'self::sanitizeKey4',
12 'key5' => '$this->sanitizeKey5',
13 ];
14
15 public string $key1 = 'default_value_1';
16 public string $key2 = 'default_value_2';
17 public string $key3 = '3';
18 public int $key4 = 3;
19 public string $key5 = 'Test Alternative';
20
21 public static function sanitizeKey3($value)
22 {
23 if (is_numeric($value)) {
24 return (string) $value;
25 }
26 return '0';
27 }
28
29 public static function sanitizeKey4($value)
30 {
31 return (int) $value;
32 }
33
34 public function sanitizeKey5($value = null)
35 {
36 return 'Test Alternative';
37 }
38 }
39