Horde_Kolab_Storage_List_Query_List_Cache_Synchronization::updateAfterRenameFolder PHP 메소드

updateAfterRenameFolder() 공개 메소드

Update the listener after renaming a folder.
public updateAfterRenameFolder ( string $old, string $new ) : null
$old string The old path of the folder.
$new string The new path of the folder.
리턴 null
    public function updateAfterRenameFolder($old, $new)
    {
        if (!$this->_cache->hasNamespace()) {
            // Cache not synchronized yet.
            return;
        }
        $folder_list = $this->_cache->getFolders();
        $folder_list = array_diff($folder_list, array($old));
        $folder_list[] = $new;
        $annotations = $this->_cache->getFolderTypes();
        if (isset($annotations[$old])) {
            $annotations[$new] = $annotations[$old];
            unset($annotations[$old]);
        }
        $namespace = unserialize($this->_cache->getNamespace());
        // Using array_values() here to make testing across PHP versions
        // easier.
        $this->_synchronize($namespace, array_values($folder_list), $annotations);
    }

Usage Example

예제 #1
0
파일: Cache.php 프로젝트: jubinpatel/horde
 /**
  * Update the listener after renaming a folder.
  *
  * @param string $old The old path of the folder.
  * @param string $new The new path of the folder.
  *
  * @return NULL
  */
 public function updateAfterRenameFolder($old, $new)
 {
     $this->_sync->updateAfterRenameFolder($old, $new);
 }
All Usage Examples Of Horde_Kolab_Storage_List_Query_List_Cache_Synchronization::updateAfterRenameFolder