+
+ /**
+ * Compute any missing fields in $row.
+ * The way the missing values are computed must correspond to the way this is done in SlotRecord.
+ *
+ * @param object $row to be modified
+ * @param string $model
+ * @param string $address
+ */
+ private function fillMissingFields( $row, $model, $address ) {
+ if ( !isset( $row->content_model ) ) {
+ // just for completeness
+ $row->content_model = $model;
+ }
+
+ if ( isset( $row->len ) && isset( $row->sha1 ) && $row->sha1 !== '' ) {
+ // No need to load the content, quite now.
+ return;
+ }
+
+ $blob = $this->blobStore->getBlob( $address );
+
+ if ( !isset( $row->len ) ) {
+ // NOTE: The nominal size of the content may not be the length of the raw blob.
+ $handler = ContentHandler::getForModelID( $model );
+ $content = $handler->unserializeContent( $blob );
+
+ $row->len = $content->getSize();
+ }
+
+ if ( !isset( $row->sha1 ) || $row->sha1 === '' ) {
+ $row->sha1 = SlotRecord::base36Sha1( $blob );
+ }
+ }