Uname: Linux webm012.cluster130.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
Software: Apache
PHP version: 8.0.30 [ PHP INFO ] PHP os: Linux
Server Ip: 145.239.37.162
Your Ip: 216.73.216.190
User: dreampi (1009562) | Group: users (100)
Safe Mode: OFF
Disable Function:
_dyuweyrj4,_dyuweyrj4r,dl

name : Base.php
<?php
namespace AIOSEO\Plugin\Addon\LocalBusiness\Schema\Graphs;

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

use AIOSEO\Plugin\Common\Schema\Graphs as CommonGraphs;

/**
 * Base graph class.
 *
 * @since 1.3.3
 */
abstract class Base extends CommonGraphs\Graph {
	/**
	 *The data for the CPT or the global options.
	 *
	 * @since 1.3.3
	 *
	 * @var object|null
	 */
	protected $dataObject = null;

	/**
	 * Returns the address.
	 *
	 * @since   1.0.0
	 * @version 1.3.3 Moved to abstract class.
	 *
	 * @return array The address.
	 */
	protected function address() {
		$streetLine1 = $this->dataObject->locations->business->address->streetLine1 ?? '';
		$streetLine2 = $this->dataObject->locations->business->address->streetLine2 ?? '';
		if ( ! $streetLine1 && ! $streetLine2 ) {
			return [];
		}

		return [
			'@id'             => trailingslashit( home_url() ) . '#postaladdress',
			'@type'           => 'PostalAddress',
			'streetAddress'   => sprintf(
				'%1$s, %2$s',
				$streetLine1,
				$streetLine2
			),
			'postalCode'      => $this->dataObject->locations->business->address->zipCode ?? '',
			'addressLocality' => $this->dataObject->locations->business->address->city ?? '',
			'addressRegion'   => $this->dataObject->locations->business->address->state ?? '',
			'addressCountry'  => $this->dataObject->locations->business->address->country ?? ''
		];
	}

	/**
	 * Returns the IDs.
	 *
	 * @since 1.3.3
	 *
	 * @return array The ids.
	 */
	protected function ids() {
		$ids = [
			'taxID'                => $this->dataObject->locations->business->ids->tax ?? '',
			'vatID'                => $this->dataObject->locations->business->ids->vat ?? '',
			'iso6523Code'          => $this->dataObject->locations->business->ids->iso6523 ?? '',
			'leiCode'              => $this->dataObject->locations->business->ids->lei ?? '',
			'duns'                 => $this->dataObject->locations->business->ids->duns ?? '',
			'naics'                => $this->dataObject->locations->business->ids->naics ?? '',
			'globalLocationNumber' => $this->dataObject->locations->business->ids->gs1 ?? ''
		];

		if ( empty( $ids['iso6523Code'] ) && ! empty( $ids['duns'] ) ) {
			$ids['iso6523Code'] = '0060:' . $ids['duns'];
		}

		if ( empty( $ids['iso6523Code'] ) && ! empty( $ids['globalLocationNumber'] ) ) {
			$ids['iso6523Code'] = '0088:' . $ids['globalLocationNumber'];
		}

		if ( empty( $ids['iso6523Code'] ) && ! empty( $ids['leiCode'] ) ) {
			$ids['iso6523Code'] = '0199:' . $ids['leiCode'];
		}

		return array_filter( $ids );
	}
}
© 2026 GrazzMean-Shell