本文整理汇总了PHP中Folder::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP Folder::getName方法的具体用法?PHP Folder::getName怎么用?PHP Folder::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Folder
的用法示例。
在下文中一共展示了Folder::getName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postFolderAdd
/**
* Call after folder addition in filelist
* Add the correct folder in the database
* @param Folder $folder
* @return void
*/
public function postFolderAdd($folder)
{
if ($folder->getParentFolder() && $folder->getParentFolder()->getName() != '') {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery("uid", "tx_ameosfilemanager_domain_model_folder", "tx_ameosfilemanager_domain_model_folder.identifier like '" . $folder->getParentFolder()->getIdentifier() . "'");
if (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) !== FALSE) {
if (Tools::getFolderPathFromUid($row['uid']) . '/' == $folder->getParentFolder()->getIdentifier()) {
$insertArray = array("tstamp" => time(), "crdate" => time(), "cruser_id" => 1, "title" => $folder->getName(), "uid_parent" => $row['uid'], "identifier" => $folder->getIdentifier());
$folderRepository = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager')->get('Ameos\\AmeosFilemanager\\Domain\\Repository\\FolderRepository');
$folderRepository->requestInsert($insertArray);
}
} else {
$this->postFolderAdd($folder->getParentFolder());
$this->postFolderAdd($folder);
}
} else {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery("uid", "tx_ameosfilemanager_domain_model_folder", "tx_ameosfilemanager_domain_model_folder.identifier like '" . $folder->getIdentifier() . "'");
if (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) === FALSE) {
$insertArray = array("tstamp" => time(), "crdate" => time(), "cruser_id" => 1, "title" => $folder->getName(), "uid_parent" => 0, "identifier" => $folder->getIdentifier());
$folderRepository = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager')->get('Ameos\\AmeosFilemanager\\Domain\\Repository\\FolderRepository');
$folderRepository->requestInsert($insertArray);
}
}
}
示例2: importFromFolder
public function importFromFolder(Folder $folder)
{
try {
$config = array('url_key' => $folder->getName());
$metadata = array('experiment_id' => -1, 'task_id' => -1);
$config = $this->getConfig($folder);
$this->logImportStart($config);
$metadata = $this->processMetadata($config);
$sentences = $this->parseResources($folder, $config);
$this->processSentences($config, $metadata, $sentences);
$this->logImportSuccess($config);
$this->showImported($metadata);
$folder->lock('imported');
} catch (\IteratorsLengthsMismatchException $exception) {
$this->handleNotMatchingNumberOfSentences($config['url_key']);
$this->handleImportError($folder, $metadata);
} catch (\ImporterException $exception) {
$this->logImportAbortion($config, $exception);
$this->handleImportError($folder, $metadata);
} catch (Exception $exception) {
$this->logger->log($exception->getMessage());
$this->handleImportError($folder, $metadata);
}
}
示例3: update
/**
* @brief Updates the folder
* @param folder the folder to be updated
*/
public function update(Folder $folder)
{
$query = \OCP\DB::prepare('UPDATE ' . self::tableName . ' SET name = ?, opened = ?' . ' WHERE id = ?');
$params = array($folder->getName(), $folder->getOpened(), $folder->getId());
$query->execute($params);
return true;
}
示例4: getDefaults
protected function getDefaults(Folder $experimentFolder)
{
return array('name' => $experimentFolder->getName(), 'url_key' => $experimentFolder->getName(), 'description' => '', 'source' => 'source.txt', 'reference' => 'reference.txt');
}
示例5: getDefaults
protected function getDefaults(Folder $folder)
{
return array('name' => $folder->getName(), 'url_key' => $folder->getName(), 'experiment' => $this->experimentsModel->getExperimentByName($folder->getParent()->getName()), 'description' => '', 'translation' => 'translation.txt', 'precompute_ngrams' => true);
}
示例6: testGetName
public function testGetName()
{
assertThat($this->folder->getName(), is($this->folderName));
}