Esempio n. 1
0
 /**
  * Load backup file info
  *
  * @param string $fileName
  * @param string $filePath
  * @return $this
  */
 public function load($fileName, $filePath)
 {
     $backupData = $this->_helper->extractDataFromFilename($fileName);
     $this->addData(['id' => $filePath . '/' . $fileName, 'time' => (int) $backupData->getTime(), 'path' => $filePath, 'extension' => $this->_helper->getExtensionByType($backupData->getType()), 'display_name' => $this->_helper->nameToDisplayName($backupData->getName()), 'name' => $backupData->getName(), 'date_object' => (new \DateTime())->setTimestamp($backupData->getTime())]);
     $this->setType($backupData->getType());
     return $this;
 }
Esempio n. 2
0
 /**
  * Load backup file info
  *
  * @param string $fileName
  * @param string $filePath
  * @return $this
  */
 public function load($fileName, $filePath)
 {
     $backupData = $this->_helper->extractDataFromFilename($fileName);
     $this->addData(array('id' => $filePath . '/' . $fileName, 'time' => (int) $backupData->getTime(), 'path' => $filePath, 'extension' => $this->_helper->getExtensionByType($backupData->getType()), 'display_name' => $this->_helper->nameToDisplayName($backupData->getName()), 'name' => $backupData->getName(), 'date_object' => new \Magento\Framework\Stdlib\DateTime\Date((int) $backupData->getTime(), $this->_localeResolver->getLocaleCode())));
     $this->setType($backupData->getType());
     return $this;
 }