public function setExpirationFolder(Folder $f)
 {
     $this->getProperty()->expirationFolderId = $f->getId();
     $this->getProperty()->expirationFolderPath = $f->getPath();
     return $this;
 }
 public function createXsltFormat(Folder $parent, $name, $xml)
 {
     if (trim($name) == "") {
         throw new e\CreationErrorException(S_SPAN . c\M::EMPTY_FORMAT_NAME . E_SPAN);
     }
     if (trim($xml) == "") {
         throw new e\CreationErrorException(S_SPAN . c\M::EMPTY_XML . E_SPAN);
     }
     $asset = AssetTemplate::getFormat(c\P::XSLTFORMAT);
     $asset->xsltFormat->name = $name;
     $asset->xsltFormat->parentFolderPath = $parent->getPath();
     $asset->xsltFormat->siteName = $parent->getSiteName();
     $asset->xsltFormat->xml = $xml;
     return $this->createAsset($asset, XsltFormat::TYPE, $this->getPath($parent, $name), $parent->getSiteName());
 }
 public function updateTemplate(Folder $f = NULL, $exception_thrown = true)
 {
     $this->checkSourceTargetSite();
     // sub-folder
     if (isset($f)) {
         $source_asset_tree = $f->getAssetTree();
     } else {
         $source_asset_tree = $this->source_site->getBaseFolderAssetTree();
     }
     $source_asset_tree->traverse(array(Template::TYPE => array("CascadeInstances::assetTreeUpdateTemplate")), array('source-site' => $this->source_site, 'target-cascade' => $this->target_cascade, 'target-site' => $this->target_site, 'exception-thrown' => $exception_thrown));
     return $this;
 }
 public function setFolder(Folder $folder)
 {
     if ($this->getIndexBlockType() != Folder::TYPE) {
         throw new \Exception(S_SPAN . "This block is not a folder index block." . E_SPAN);
     }
     $this->getProperty()->indexedFolderId = $folder->getId();
     $this->getProperty()->indexedFolderPath = $folder->getPath();
     return $this;
 }
 public function setPlacementFolder(Folder $folder)
 {
     if ($folder == NULL) {
         throw new e\NullAssetException(S_SPAN . c\M::NULL_FOLDER . E_SPAN);
     }
     $this->getProperty()->placementFolderId = $folder->getId();
     $this->getProperty()->placementFolderPath = $folder->getPath();
     return $this;
 }
 public function removeFolder(Folder $folder)
 {
     $id = $folder->getId();
     $temp = array();
     foreach ($this->folders as $folder) {
         if ($folder->getId() != $id) {
             $temp[] = $folder;
         }
     }
     $this->folders = $temp;
     return $this;
 }