DummySelectSQL($platform->getCurrentDatabaseExpression()); $database = $this->fetchOne($query); assert(is_strinџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџщ#jВа€`TqQ^џџџџjnрTxЩШРмюK^Z^v1€@Џ1L^blic function getDriver() { return $this->_driver; } /** * Gets the Configuration used by the Connection. * * @return Configџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџр§qQ^џџџџщ#jВа€рџqQ^рL.L^џџџџjnрTxЩШ` L^ Ў6L^Z^v1€Ё6L^ * * @deprecated * * @return EventManager */ public function getEventManager() { Deprecation::triggerIfCalledFromOutsideџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџщ#jВа€рџqQ^џџџџjnрTxЩШ` L^Z^v1€Ё6L^ return $this->_eventManager; } /** * Gets the DatabasePlatform for the connection. * * @return AbstractPlatform * * @tџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ ёqQ^џџџџщ#jВа€РЄrQ^  8L^џџџџjnрTxЩШ€a L^рЋ1L^Z^v1€€Ђ6L^asePlatform(); $this->platform->setEventManager($this->_eventManager); $this->platform->setDisableTypeComments($this->_config->getDisablџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџщ#jВа€РЄrQ^џџџџjnрTxЩШ€a L^Z^v1€€Ђ6L^ createExpressionBuilder(): ExpressionBuilder { return new ExpressionBuilder($this); } /** * Gets the ExpressionBuilder for the connecџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџщ#jВа€Р9L^џџџџjnрTxЩШ RL^Z^v1€@Ё,L^иЕ@з ЕчЬnЖАЕL^дsQ^џџџџ ъЛ=(vЩШo L^˜У L^џџџџ:MOы№5›Р0,lQ^ˆЩ L^џџџџ ЖіfAч€ИС L^€иL^ъ|љ}U:˜РPL^џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрœ7L^џџџџщ#jВа€Р9L^р 9L^џџџџjnрTxЩШ RL^PвЕ@Z^v1€@Ё,L^з ЕчЬnЖАЕL^џџџџ ъЛ=(vЩШo L^џџџџ:MOы№5›Р0,lQ^џџџџ ЖіfAч€ИС L^ъ|љ}U:˜РPL^џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџњqQ^џџџџ]tP˜‹ЈОL^р\rQ^]ЌЋfvађйПL^иЕ@=eО V|саrhQ^8L^џџџџщ#jВа€`љqQ^c9L^џџџџjnрTxЩШаRL^ 8L^џџџџNEPCОлн@"L^јrhQ^Z^v1€ 9L^alledFromOutside( 'dџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ]tP˜‹ЈОL^]ЌЋfvађйПL^=eО V|саrhQ^џџџџщ#jВа€`љqQ^џџџџjnрTxЩШаRL^џџџџNEPCОлн@"L^Z^v1€ 9L^onnect($this->params); }џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ8L^џџџџщ#jВа€@h9L^`Ђ6L^џџџџjnрTxЩШАTL^PвЕ@Z^v1€ре2L^saction(); } if ($this->_eventManager->hasListeners(Events::postConnect)) { Deprecation::trigger( 'doctrine/dbal', џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџщ#jВа€@h9L^џџџџjnрTxЩШАTL^Z^v1€ре2L^ Events::postConnect, ); $eventArgs = new Event\ConnectionEventArgs($this); $this->_eventManager->dispatchEvent(Eџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ Ѕ6L^џџџџщ#jВа€@‘7L^€Ў6L^џџџџjnрTxЩШ€TL^PjQ^Z^v1€@Љ6L^atform class and version in order to set the correct platform. * * @throws Exception If an invalid platform was specified for this connection. */џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџщ#jВа€@‘7L^џџџџjnрTxЩШ€TL^ay be defined, * however the ones described below are supported by default. Default empty array. * * @type string $api_version Block API version. * @type string $title Human-readable block type label. * @type string|null $category Block type category classification, used in * search interfaces to arrange block types by category. * @type array|null $parent Setting parent lets a block require that it is only * available when nested within the specified blocks. * @type array|null $ancestor Setting ancestor makes a block available only inside the specified * block types at any position of the ancestor's block subtree. * @type string|null $icon Block type icon. * @type string $description A detailed block type description. * @type string[] $keywords Additional keywords to produce block type as * result in search interfaces. * @type string|null $textdomain The translation textdomain. * @type array $styles Alternative block styles. * @type array $variations Block variations. * @type array|null $supports Supported features. * @type array|null $example Structured data for the block preview. * @type callable|null $render_callback Block type render callback. * @type array|null $attributes Block type attributes property schemas. * @type array $uses_context Context values inherited by blocks of this type. * @type array|null $provides_context Context provided by blocks of this type. * @type string|null $editor_script Block type editor only script handle. * @type string|null $script Block type front end and editor script handle. * @type string|null $view_script Block type front end only script handle. * @type string|null $editor_style Block type editor only style handle. * @type string|null $style Block type front end and editor style handle. * } */ public function __construct( $block_type, $args = array() ) { $this->name = $block_type; $this->set_props( $args ); } /** * Renders the block type output for given attributes. * * @since 5.0.0 * * @param array $attributes Optional. Block attributes. Default empty array. * @param string $content Optional. Block content. Default empty string. * @return string Rendered block type output. */ public function render( $attributes = array(), $content = '' ) { if ( ! $this->is_dynamic() ) { return ''; } $attributes = $this->prepare_attributes_for_render( $attributes ); return (string) call_user_func( $this->render_callback, $attributes, $content ); } /** * Returns true if the block type is dynamic, or false otherwise. A dynamic * block is one which defers its rendering to occur on-demand at runtime. * * @since 5.0.0 * * @return bool Whether block type is dynamic. */ public function is_dynamic() { return is_callable( $this->render_callback ); } /** * Validates attributes against the current block schema, populating * defaulted and missing values. * * @since 5.0.0 * * @param array $attributes Original block attributes. * @return array Prepared block attributes. */ public function prepare_attributes_for_render( $attributes ) { // If there are no attribute definitions for the block type, skip // processing and return verbatim. if ( ! isset( $this->attributes ) ) { return $attributes; } foreach ( $attributes as $attribute_name => $value ) { // If the attribute is not defined by the block type, it cannot be // validated. if ( ! isset( $this->attributes[ $attribute_name ] ) ) { continue; } $schema = $this->attributes[ $attribute_name ]; // Validate value by JSON schema. An invalid value should revert to // its default, if one exists. This occurs by virtue of the missing // attributes loop immediately following. If there is not a default // assigned, the attribute value should remain unset. $is_valid = rest_validate_value_from_schema( $value, $schema, $attribute_name ); if ( is_wp_error( $is_valid ) ) { unset( $attributes[ $attribute_name ] ); } } // Populate values of any missing attributes for which the block type // defines a default. $missing_schema_attributes = array_diff_key( $this->attributes, $attributes ); foreach ( $missing_schema_attributes as $attribute_name => $schema ) { if ( isset( $schema['default'] ) ) { $attributes[ $attribute_name ] = $schema['default']; } } return $attributes; } /** * Sets block type properties. * * @since 5.0.0 * * @param array|string $args Array or string of arguments for registering a block type. * See WP_Block_Type::__construct() for information on accepted arguments. */ public function set_props( $args ) { $args = wp_parse_args( $args, array( 'render_callback' => null, ) ); $args['name'] = $this->name; // Setup attributes if needed. if ( ! isset( $args['attributes'] ) || ! is_array( $args['attributes'] ) ) { $args['attributes'] = array(); } // Register core attributes. foreach ( static::GLOBAL_ATTRIBUTES as $attr_key => $attr_schema ) { if ( ! array_key_exists( $attr_key, $args['attributes'] ) ) { $args['attributes'][ $attr_key ] = $attr_schema; } } /** * Filters the arguments for registering a block type. * * @since 5.5.0 * * @param array $args Array of arguments for registering a block type. * @param string $block_type Block type name including namespace. */ $args = apply_filters( 'register_block_type_args', $args, $this->name ); foreach ( $args as $property_name => $property_value ) { $this->$property_name = $property_value; } } /** * Get all available block attributes including possible layout attribute from Columns block. * * @since 5.0.0 * * @return array Array of attributes. */ public function get_attributes() { return is_array( $this->attributes ) ? $this->attributes : array(); } }