Meta.php
884 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
namespace ACA\JetEngine\Column;
use AC;
use ACA\JetEngine\Export;
use ACA\JetEngine\Field\Field;
use ACA\JetEngine\Service\ColumnGroups;
use ACP;
class Meta extends AC\Column implements ACP\Export\Exportable {
/**
* @var Field
*/
protected $field;
public function __construct() {
$this->set_group( ColumnGroups::JET_ENGINE )
->set_label( 'JetEngine Meta' );
}
public function get_raw_value( $id ) {
return get_metadata( $this->list_screen->get_meta_type(), $id, $this->get_type(), true );
}
protected function get_meta_type() {
return $this->list_screen->get_meta_type();
}
// Delayed constructor
public function set_field( Field $field ) {
$this->field = $field;
}
protected function get_meta_key() {
return $this->get_type();
}
public function export() {
return ( new Export\ModelFactory() )->create( $this, $this->field );
}
}