Exemplo n.º 1
0
 public function onPreSave(MetadataChangeEvent $event)
 {
     $metadata = $event->getDataset();
     $p = $metadata->getObject();
     $p = $this->rebuildArrayKeys($p);
     if (strtolower($p['hierarchyLevel']) === 'service') {
         $p = $this->prepairService($p);
     }
     $metadata->setObject($p);
 }
Exemplo n.º 2
0
 /**
  * Removes the metadata xml from the filesystem.
  * @param  MetadataChangeEvent $event
  */
 public function onDelete(MetadataChangeEvent $event)
 {
     $metadata = $event->getDataset();
     $config = $event->getConfig();
     $filename = rtrim($config['export']['path'], '/');
     if ($this->testPath($config['export']['path'])) {
         $filename .= '/' . md5($metadata->getUuid()) . '.xml';
         if (file_exists($filename)) {
             unlink($filename);
         }
     }
 }