first commit

This commit is contained in:
2024-11-10 21:08:49 +01:00
commit 0d932ce5ee
14455 changed files with 2567501 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
<?php
class ET_Builder_Module_Fields_Factory {
protected static $fields = array();
/**
* @param $fields_type
*
* @return ET_Builder_Module_Field_Base
*/
public static function get( $fields_type ) {
if ( ! isset( self::$fields[ $fields_type ] ) ) {
$file = implode( DIRECTORY_SEPARATOR, array( ET_BUILDER_DIR, 'module', 'field', "$fields_type.php" ) );
$instance = file_exists( $file ) ? require_once $file : null;
self::$fields[ $fields_type ] = $instance instanceof ET_Builder_Module_Field_Base ? $instance : null;
}
return self::$fields[ $fields_type ];
}
}