PluginProbe ʕ •ᴥ•ʔ
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel / trunk
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel vtrunk
trunk 0.9.0 0.9.1 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.2.0 1.2.1 1.2.10 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 1.4.14 1.4.15 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0
wp-all-export / addon-api / classes / resolver.php
wp-all-export / addon-api / classes Last commit date
base.php 3 weeks ago exporter.php 3 weeks ago helpers.php 3 weeks ago resolver.php 3 weeks ago updater.php 3 weeks ago view.php 3 weeks ago
resolver.php
35 lines
1 <?php
2
3 namespace Wpae\AddonAPI;
4
5 if ( ! defined( 'ABSPATH' ) ) exit;
6
7 class PMXE_Addon_Resolver {
8
9 public PMXE_Addon_Base $addon;
10 public $record;
11 public $recordId;
12
13 public function __construct( PMXE_Addon_Base $addon, $object, $recordId ) {
14 $this->addon = $addon;
15 $this->record = $object;
16 $this->recordId = $recordId;
17 }
18
19 public function getCast( $type ) {
20 return $this->addon->casts[ $type ] ?? null;
21 }
22
23 public function resolveFieldValue( PMXE_Addon_Field $field ) {
24 $value = $this->addon->resolveFieldValue( $field, $this->record, $this->recordId );
25
26 return $this->processValue( $field, $value );
27 }
28
29 public function processValue( PMXE_Addon_Field $field, $value ) {
30 $cast = $this->getCast( $field->type );
31
32 return $cast ? ( new $cast )( $field, $value ) : $value;
33 }
34 }
35