예제 #1
0
 /**
  * Process errors
  *
  * @return bool
  */
 protected function checkForErrors()
 {
     foreach ($this->errors as $error) {
         $this->logger->warning($error);
     }
     return empty($this->errors);
 }
예제 #2
0
 /**
  * @return bool
  */
 protected function volume()
 {
     $result = true;
     $this->progress->start(1);
     $this->progress->advance();
     $ratingsShouldBeActive = [];
     $ratingsIsActive = [];
     /** @var \Migration\Resource\Adapter\Mysql $adapter */
     $adapter = $this->destination->getAdapter();
     /** @var \Magento\Framework\DB\Select $select */
     $select = $adapter->getSelect()->from($this->getRatingStoreDocument(), ['rating_id'])->where('store_id > 0');
     $ratingsStore = $adapter->loadDataFromSelect($select);
     foreach ($ratingsStore as $rating) {
         $ratingsShouldBeActive[] = $rating['rating_id'];
     }
     $ratingsShouldBeActive = array_unique($ratingsShouldBeActive);
     /** @var \Magento\Framework\DB\Select $select */
     $select = $adapter->getSelect()->from($this->getRatingDocument(), ['rating_id'])->where('is_active = ?', 1);
     $ratings = $adapter->loadDataFromSelect($select);
     foreach ($ratings as $rating) {
         $ratingsIsActive[] = $rating['rating_id'];
     }
     if (count(array_intersect($ratingsShouldBeActive, $ratingsIsActive)) != count($ratingsShouldBeActive)) {
         $this->logger->warning(sprintf('Mismatch of entities in the documents: %s, %s', self::RATING_TABLE_NAME, self::RATING_STORE_TABLE_NAME));
         $result = false;
     }
     $this->progress->finish();
     return $result;
 }
예제 #3
0
 /**
  * Volume check
  *
  * @return bool
  */
 protected function volume()
 {
     $result = true;
     $this->progress->start(1);
     $result &= $this->source->getRecordsCount(self::SOURCE) == $this->destination->getRecordsCount(self::DESTINATION);
     if (!$result) {
         $this->logger->warning('Mismatch of entities in the document: url_rewrite');
     }
     $this->progress->advance();
     $this->progress->finish();
     return (bool) $result;
 }
예제 #4
0
 /**
  * @return bool
  */
 public function checkMismatchDocumentFieldDataTypes()
 {
     if (isset($this->mismatchDocumentFieldDataTypes[MapInterface::TYPE_SOURCE])) {
         foreach ($this->mismatchDocumentFieldDataTypes[MapInterface::TYPE_SOURCE] as $document => $fields) {
             $this->logger->warning(sprintf('Mismatch of data types. Source document: %s. Fields: %s', $document, implode(',', $fields)));
         }
     }
     if (isset($this->mismatchDocumentFieldDataTypes[MapInterface::TYPE_DEST])) {
         foreach ($this->mismatchDocumentFieldDataTypes[MapInterface::TYPE_DEST] as $document => $fields) {
             $this->logger->warning(sprintf('Mismatch of data types. Destination document: %s. Fields: %s', $document, implode(',', $fields)));
         }
     }
     return true;
 }
예제 #5
0
파일: Stores.php 프로젝트: okite11/frames21
 /**
  * Volume check
  *
  * @return bool
  */
 protected function volume()
 {
     $result = true;
     $this->progress->start(count($this->getDocumentList()));
     foreach ($this->getDocumentList() as $sourceName => $destinationName) {
         $this->progress->advance();
         if ($this->source->getRecordsCount($sourceName) != $this->destination->getRecordsCount($destinationName)) {
             $this->logger->warning('Mismatch of entities in the document: ' . $destinationName);
             $result = false;
         }
     }
     $this->progress->finish();
     return $result;
 }