Exemplo n.º 1
0
 /**
  * @return bool
  */
 protected function integrity()
 {
     $this->progress->start(1);
     $this->progress->advance();
     $documents = $this->destination->getDocumentList();
     if (!in_array(self::RATING_TABLE_NAME, $documents) || !in_array(self::RATING_STORE_TABLE_NAME, $documents)) {
         $this->logger->error(sprintf('Integrity check failed due to "%s" or "%s" documents do not exist in the destination resource', self::RATING_TABLE_NAME, self::RATING_STORE_TABLE_NAME));
         return false;
     }
     $structureRating = $this->destination->getDocument(self::RATING_TABLE_NAME)->getStructure()->getFields();
     if (!array_key_exists('is_active', $structureRating)) {
         $this->logger->error(sprintf('Integrity check failed due to "is_active" field does not exist in "%s" document of' . ' the destination resource', self::RATING_TABLE_NAME));
         return false;
     }
     $this->progress->finish();
     return true;
 }
Exemplo n.º 2
0
 /**
  * @return bool
  */
 protected function integrity()
 {
     $this->progress->start(1);
     $this->progress->advance();
     $documents = $this->source->getDocumentList();
     if (!in_array(self::CONFIG_TABLE_NAME_SOURCE, $documents)) {
         $this->logger->error(sprintf('Integrity check failed due to "%s" document does not exist in the source resource', self::CONFIG_TABLE_NAME_SOURCE));
         return false;
     }
     $documents = $this->destination->getDocumentList();
     if (!in_array(self::CONFIG_TABLE_NAME_DESTINATION, $documents)) {
         $this->logger->error(sprintf('Integrity check failed due to "%s" document does not exist in the destination resource', self::CONFIG_TABLE_NAME_DESTINATION));
         return false;
     }
     $this->progress->finish();
     return true;
 }