File.php
1.12 KB
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
45
46
47
48
49
50
51
52
53
54
55
<?php
namespace ACA\Pods\Field;
use AC;
use AC\Collection;
use ACA\Pods\Editing;
use ACA\Pods\Export;
use ACA\Pods\Field;
use ACP\Search;
class File extends Field {
public function get_value( $id ) {
return $this->column->get_formatted_value( new Collection( $this->get_raw_value( $id ) ) );
}
public function get_raw_value( $id ) {
return (array) $this->get_db_value( $id );
}
public function get_separator() {
return ' ';
}
public function editing() {
return new Editing\Service\FieldStorage(
new Editing\Storage\File( $this->get_pod(), $this->get_field_name(), $this->get_meta_type() ),
( new Editing\ViewFactory() )->create_by_field( $this )
);
}
public function export() {
return new Export\File( $this->column );
}
public function search() {
return new Search\Comparison\Meta\Media( $this->get_meta_key(), $this->column->get_meta_type() );
}
public function get_dependent_settings() {
$settings = [];
switch ( $this->get_option( 'file_type' ) ) {
case 'images' :
case 'any' :
$settings[] = new AC\Settings\Column\Image( $this->column );
break;
}
return $settings;
}
}