HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: /var/www/html/shootinschool/wp-content/plugins/wp-google-maps/includes/class.pointlabel.php
<?php

namespace WPGMZA;

if(!defined('ABSPATH'))
	return;

class Pointlabel extends Feature {
	private $_center;

	public function __construct($id_or_fields=-1, $read_mode=Crud::SINGLE_READ){
		global $wpdb;
		global $WPGMZA_TABLE_NAME_POINT_LABELS;
		
		$this->_center = new LatLng();
		
		Crud::__construct($WPGMZA_TABLE_NAME_POINT_LABELS, $id_or_fields, $read_mode);
	}

	protected function get_column_parameter($name){
		if($name == 'center')
			return "POINT(" . floatval($this->center->lat) . " " . floatval($this->center->lng) . ")";
		
		return Crud::get_column_parameter($name);
	}

	public function __get($name){
		switch($name){
			case "center":
				return $this->{"_$name"};
				break;
			default:
				break;
		}
	}
	
	public function __set($name, $value){
		switch($name){
			case "center":
				$this->_center = new LatLng($value);
				break;
			default:
				break;
		}
	}
	
	public function set($arg, $val=null){
		if(is_array($arg) && isset($arg['center'])){
			$arg['center'] = $this->_center = new LatLng($arg['center']);
		} else if(is_object($arg) && isset($arg->center)){
			$arg->center = $this->_center = new LatLng($arg->center);
		}
		
		Crud::set($arg, $val);
	}
	
}