You are here

protected function AmpPrepareMetadataJson::checkMetadataComplete in Accelerated Mobile Pages (AMP) 8

Check if metadata JSON is complete.

1 call to AmpPrepareMetadataJson::checkMetadataComplete()
AmpPrepareMetadataJson::getJson in src/Utility/AmpPrepareMetadataJson.php
Gets the encoded AMP metadata JSON.

File

src/Utility/AmpPrepareMetadataJson.php, line 397

Class

AmpPrepareMetadataJson
Class AmpPrepareMetadataJson

Namespace

Drupal\amp\Utility

Code

protected function checkMetadataComplete() {
  $completed = [];
  foreach ($this->ampMetadataList as $metadatum) {
    $completed[$metadatum] = isset($this->ampPreparedMetadataJson[$metadatum]) ? !empty($this->ampPreparedMetadataJson[$metadatum]) : FALSE;
  }
  $this->ampMetadataComplete = TRUE;
  foreach ($completed as $item_complete) {
    if ($item_complete === FALSE) {
      $this->ampMetadataComplete = FALSE;
    }
  }
}