PluginProbe
Elementor Website Builder – more than just a page builder / 3.4.2
Elementor Website Builder – more than just a page builder v3.4.2
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
elementor / modules / system-info / helpers / model-helper.php

model-helper.php in Elementor Website Builder – more than just a page builder 3.4.2, at modules/system-info/helpers/model-helper.php

69 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor\Modules\System_Info\Helpers;
3
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit; // Exit if accessed directly.
6 }
7
8 /**
9 * Elementor model helper.
10 *
11 * Elementor model helper handler class is responsible for filtering properties.
12 *
13 * @since 1.0.0
14 */
15 final class Model_Helper {
16
17 /**
18 * Model helper constructor.
19 *
20 * Initializing the model helper class.
21 *
22 * @since 1.0.0
23 * @access private
24 */
25 private function __construct() {}
26
27 /**
28 * Filter possible properties.
29 *
30 * Retrieve possible properties filtered by property intersect key.
31 *
32 * @since 1.0.0
33 * @access public
34 * @static
35 *
36 * @param array $possible_properties All the possible properties.
37 * @param array $properties Properties to filter.
38 *
39 * @return array Possible properties filtered by property intersect key.
40 */
41 public static function filter_possible_properties( $possible_properties, $properties ) {
42 $properties_keys = array_flip( $possible_properties );
43
44 return array_intersect_key( $properties, $properties_keys );
45 }
46
47 /**
48 * Prepare properties.
49 *
50 * Combine the possible properties with the user properties and filter them.
51 *
52 * @since 1.0.0
53 * @access public
54 * @static
55 *
56 * @param array $possible_properties All the possible properties.
57 * @param array $user_properties User properties.
58 *
59 * @return array Possible properties and user properties filtered by property intersect key.
60 */
61 public static function prepare_properties( $possible_properties, $user_properties ) {
62 $properties = array_fill_keys( $possible_properties, null );
63
64 $properties = array_merge( $properties, $user_properties );
65
66 return self::filter_possible_properties( $possible_properties, $properties );
67 }
68 }
69