123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- <?php
- /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- namespace Magento\Deploy\Package;
- use Magento\Framework\View\Asset;
- use Magento\Framework\View\Asset\Repository;
- /**
- * Deployment Package File class
- */
- class PackageFile extends Asset
- {
- /**
- * @var Package
- */
- private $package;
- /**
- * @var Package
- */
- private $origPackage;
- /**
- * @var string
- */
- private $deployedFileName;
- /**
- * @var string
- */
- private $deployedFilePath;
- /**
- * @var string
- */
- private $content;
- /**
- * @param Package $package
- * @return bool
- */
- public function setPackage(Package $package)
- {
- $this->package = $package;
- if ($this->origPackage === null) {
- $this->origPackage = $package;
- }
- $package->addFile($this);
- $package->addFileToMap($this);
- return true;
- }
- /**
- * @return Package
- */
- public function getPackage()
- {
- return $this->package;
- }
- /**
- * @return Package
- */
- public function getOrigPackage()
- {
- return $this->origPackage;
- }
- /**
- * @param string $name
- * @return bool
- */
- public function setDeployedFileName($name)
- {
- $this->deployedFileName = $name;
- return true;
- }
- /**
- * @return string
- */
- public function getDeployedFileName()
- {
- return $this->deployedFileName;
- }
- /**
- * @param string $name
- * @return bool
- */
- public function setDeployedFilePath($name)
- {
- $this->deployedFilePath = $name;
- return true;
- }
- /**
- * @return string
- */
- public function getDeployedFilePath()
- {
- return $this->deployedFilePath;
- }
- /**
- * @return string
- */
- public function getDeployedFileId()
- {
- if ($this->getModule()) {
- return $this->getModule() . Repository::FILE_ID_SEPARATOR . $this->getDeployedFileName();
- }
- return $this->getDeployedFileName();
- }
- /**
- * @return string
- */
- public function getContent()
- {
- return $this->content;
- }
- /**
- * @param string $content
- * @return bool
- */
- public function setContent($content)
- {
- $this->content = $content;
- return true;
- }
- /**
- * @param string $area
- * @return bool
- */
- public function setArea($area)
- {
- $this->area = $area;
- return true;
- }
- /**
- * @param string $theme
- * @return bool
- */
- public function setTheme($theme)
- {
- $this->theme = $theme;
- return true;
- }
- /**
- * @param string $locale
- * @return bool
- */
- public function setLocale($locale)
- {
- $this->locale = $locale;
- return true;
- }
- /**
- * @param string $module
- * @return bool
- */
- public function setModule($module)
- {
- $this->module = $module;
- return true;
- }
- }
|