PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / trunk
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF vtrunk
2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.9 2.2.8 trunk 1.10 1.3.3 1.3.4 1.3.5 1.3.5.1 1.3.5.2 1.3.6 1.3.6.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.5 All 103 releases
← All changes | classes/Traits/MediaRowTrait.php +10 -29 1.10 → trunk View file →
@@ -1,9 +1,7 @@
1 1 <?php
2 2 namespace Imagify\Traits;
3 3
4 -defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );
5 -
6 4 /**
7 5 * Trait to use to connect medias and database.
8 6 * It also cache the results.
9 7 * Classes using that trait must define a protected property $db_class_name (string) containing the media SQL DB class name.
@@ -8,9 +6,8 @@
8 6 * It also cache the results.
9 7 * Classes using that trait must define a protected property $db_class_name (string) containing the media SQL DB class name.
10 8 *
11 9 * @since 1.9
12 - * @author Grégory Viguier
13 10 */
14 11 trait MediaRowTrait {
15 12
16 13 /**
@@ -15,12 +12,10 @@
15 12
16 13 /**
17 14 * The media SQL data row.
18 15 *
19 - * @var array
20 - * @since 1.9
21 - * @access protected
22 - * @author Grégory Viguier
16 + * @var ?array
17 + * @since 1.9
23 18 */
24 19 protected $row;
25 20
26 21 /**
@@ -25,12 +20,10 @@
25 20
26 21 /**
27 22 * The media ID.
28 23 *
29 - * @var int
30 - * @since 1.9
31 - * @access protected
32 - * @author Grégory Viguier
24 + * @var int
25 + * @since 1.9
33 26 */
34 27 protected $id;
35 28
36 29 /**
@@ -35,11 +28,9 @@
35 28
36 29 /**
37 30 * Get the row.
38 31 *
39 - * @since 1.9
40 - * @access public
41 - * @author Grégory Viguier
32 + * @since 1.9
42 33 *
43 34 * @return array
44 35 */
45 36 public function get_row() {
@@ -62,11 +53,9 @@
62 53
63 54 /**
64 55 * Update the row.
65 56 *
66 - * @since 1.9
67 - * @access public
68 - * @author Grégory Viguier
57 + * @since 1.9
69 58 *
70 59 * @param array $data The data to update.
71 60 */
72 61 public function update_row( $data ) {
@@ -81,11 +70,9 @@
81 70
82 71 /**
83 72 * Delete the row.
84 73 *
85 - * @since 1.9
86 - * @access public
87 - * @author Grégory Viguier
74 + * @since 1.9
88 75 */
89 76 public function delete_row() {
90 77 if ( ! $this->db_class_name || $this->id <= 0 ) {
91 78 return;
@@ -98,11 +85,9 @@
98 85
99 86 /**
100 87 * Shorthand to get the DB table instance.
101 88 *
102 - * @since 1.9
103 - * @access public
104 - * @author Grégory Viguier
89 + * @since 1.9
105 90 *
106 91 * @return \Imagify\DB\DBInterface The DB table instance.
107 92 */
108 93 public function get_row_db_instance() {
@@ -111,11 +96,9 @@
111 96
112 97 /**
113 98 * Invalidate the row, by setting it to an empty array.
114 99 *
115 - * @since 1.9
116 - * @access public
117 - * @author Grégory Viguier
100 + * @since 1.9
118 101 *
119 102 * @return array The row.
120 103 */
121 104 public function invalidate_row() {
@@ -125,11 +108,9 @@
125 108
126 109 /**
127 110 * Reset the row cache.
128 111 *
129 - * @since 1.9
130 - * @access public
131 - * @author Grégory Viguier
112 + * @since 1.9
132 113 *
133 114 * @return null The row.
134 115 */
135 116 public function reset_row_cache() {