exportFileBased() public method

public exportFileBased ( string $property ) : string
$property string
return string
コード例 #1
0
    /**
     * @param Bundle $bundle
     * @param $property
     * @return bool
     */
    public function saveFileBased(Bundle $bundle, $property)
    {
        $xml = $bundle->exportFileBased($property);
        $xmlFile = $bundle->getPropertyFilePath($property);
        $emptyXml = '<config>
  <bundle/>
</config>';
        if ($xml == $emptyXml) {
            if ($this->localFilesystem->has($xmlFile)) {
                return $this->localFilesystem->delete($xmlFile);
            } else {
                return true;
            }
        } else {
            return $this->localFilesystem->write($xmlFile, $xml);
        }
    }