PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.5.4
JetFormBuilder — Dynamic Blocks Form Builder v3.5.4
3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / includes / classes / resources / file-collection.php
jetformbuilder / includes / classes / resources Last commit date
file-collection.php 1 year ago file-tools.php 2 years ago file.php 1 year ago has-error-file.php 2 years ago media-block-value.php 1 year ago sanitize-file-exception.php 2 years ago upload-dir.php 1 year ago upload-exception.php 2 years ago upload-permission-exception.php 2 years ago uploaded-collection.php 1 year ago uploaded-file-path.php 2 years ago uploaded-file.php 1 year ago
file-collection.php
84 lines
1 <?php
2
3
4 namespace Jet_Form_Builder\Classes\Resources;
5
6 use Jet_Form_Builder\Classes\Arrayable\Collection;
7
8 // If this file is called directly, abort.
9 if ( ! defined( 'WPINC' ) ) {
10 die;
11 }
12
13 class File_Collection extends Collection implements Media_Block_Value, Has_Error_File {
14
15 public function push( array $file ): bool {
16 try {
17 $file = new File( $file );
18 } catch ( Sanitize_File_Exception $exception ) {
19 return false;
20 }
21 $this->add( $file );
22
23 return true;
24 }
25
26 public function push_files( array $files ): File_Collection {
27 foreach ( $files as $file ) {
28 $this->push( $file );
29 }
30
31 return $this;
32 }
33
34 public function has_error(): bool {
35 /** @var File $file */
36 foreach ( $this as $file ) {
37 if ( $file->has_error() ) {
38 return true;
39 }
40 }
41
42 return false;
43 }
44
45 /*
46 * Realisation of
47 * \Jet_Form_Builder\Classes\Resources\Media_Block_Value
48 */
49
50 /**
51 * @return string
52 */
53 public function get_attachment_id(): string {
54 return '';
55 }
56
57 /**
58 * @return string
59 */
60 public function get_attachment_url(): string {
61 $urls = array();
62
63 foreach ( $this as $file ) {
64 $urls[] = $file->get_attachment_url();
65 }
66
67 return implode( ',', $urls );
68 }
69
70 /**
71 * @return array
72 */
73 public function get_attachment_both(): array {
74 return array();
75 }
76
77 /**
78 * @return array
79 */
80 public function get_attachment_ids(): array {
81 return array();
82 }
83 }
84