@@ -78,6 +78,13 @@ class Post {
7878 */
7979 private $ editable ;
8080
81+ /**
82+ * The images and their variations for this post.
83+ *
84+ * @var array<string, int|string>
85+ */
86+ private $ images ;
87+
8188 /**
8289 * Whether each field needs improvement, keyed by field param (e.g. `seo_title`). Empty for a post whose
8390 * fields are not editable.
@@ -117,21 +124,22 @@ class Post {
117124 /**
118125 * The constructor.
119126 *
120- * @param int $id The post ID.
121- * @param string $title The post title.
122- * @param string $status The post status.
123- * @param string $edit_link The URL to edit the post.
124- * @param string $focus_keyphrase The focus keyphrase.
125- * @param string $seo_title The raw stored SEO title.
126- * @param string $meta_description The raw stored meta description.
127- * @param string $social_title The raw stored social title.
128- * @param string $social_description The raw stored social description.
129- * @param bool $editable Whether the current user may edit this post.
130- * @param array<string, bool> $needs_improvement Whether each field needs improvement, keyed by field param.
131- * @param string $seo_title_fallback The post type's SEO title template (empty when stored value is set).
132- * @param string $meta_description_fallback The post type's meta description template (empty when stored value is set).
133- * @param string $social_title_fallback The post type's social title template (empty when stored value is set).
134- * @param string $social_description_fallback The post type's social description template (empty when stored value is set).
127+ * @param int $id The post ID.
128+ * @param string $title The post title.
129+ * @param string $status The post status.
130+ * @param string $edit_link The URL to edit the post.
131+ * @param string $focus_keyphrase The focus keyphrase.
132+ * @param string $seo_title The raw stored SEO title.
133+ * @param string $meta_description The raw stored meta description.
134+ * @param string $social_title The raw stored social title.
135+ * @param string $social_description The raw stored social description.
136+ * @param bool $editable Whether the current user may edit this post.
137+ * @param array<string, bool> $needs_improvement Whether each field needs improvement, keyed by field param.
138+ * @param string $seo_title_fallback The post type's SEO title template (empty when stored value is set).
139+ * @param string $meta_description_fallback The post type's meta description template (empty when stored value is set).
140+ * @param string $social_title_fallback The post type's social title template (empty when stored value is set).
141+ * @param string $social_description_fallback The post type's social description template (empty when stored value is set).
142+ * @param array<string, int|string> $images The images and their variations for this post.
135143 */
136144 public function __construct (
137145 int $ id ,
@@ -148,7 +156,8 @@ public function __construct(
148156 string $ seo_title_fallback = '' ,
149157 string $ meta_description_fallback = '' ,
150158 string $ social_title_fallback = '' ,
151- string $ social_description_fallback = ''
159+ string $ social_description_fallback = '' ,
160+ array $ images = []
152161 ) {
153162 $ this ->id = $ id ;
154163 $ this ->title = $ title ;
@@ -165,6 +174,7 @@ public function __construct(
165174 $ this ->meta_description_fallback = $ meta_description_fallback ;
166175 $ this ->social_title_fallback = $ social_title_fallback ;
167176 $ this ->social_description_fallback = $ social_description_fallback ;
177+ $ this ->images = $ images ;
168178 }
169179
170180 /**
@@ -197,6 +207,7 @@ public function to_array(): array {
197207 ],
198208 $ this ->needs_improvement ,
199209 ),
210+ 'images ' => $ this ->images ,
200211 ];
201212 }
202213}
0 commit comments