photo??null; } public function setPhoto(ImageObject|Photograph $photo):void { $this->photo = $photo; } public function getPhotoFieldConfig():array { return [ 'type' => 'upload', 'multiple' => false, 'label' => 'Photo', 'hint' => 'A photograph of this place.' ]; } public function setPhotoField(Fields $fields):void { $fields->addField( 'outside_photo', [ 'type' => 'image', 'limit' => 1, 'label' => __('Outside Photo', 'jvb') ] ); } public function formatPhotoField(Meta $meta):void { $image = $meta->get('outside_photo'); if (!empty($image) && $image > 0) { $image = $this->createImageFromID($image); if ($image) { $this->setPhoto($image); } } } }