本文整理汇总了PHP中Folder::setTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP Folder::setTitle方法的具体用法?PHP Folder::setTitle怎么用?PHP Folder::setTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Folder
的用法示例。
在下文中一共展示了Folder::setTitle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Folder
/**
* Maps a Folder object contained in a recordset to an object representation
*
* @param $rs Recordset filled with the object data
* @return objeto Mapped Folder object
*/
function &mapOne($rs)
{
if ($rs == null) {
return null;
}
$object = new Folder();
$object->setId($rs->fields["ID"]);
$object->setLongDescription($rs->fields["longDescription"]);
$object->setParentId($rs->fields["parentID"]);
$object->setPosition($rs->fields["position"]);
$object->setShortDescription($rs->fields["shortDescription"]);
$object->setTitle($rs->fields["title"]);
return $object;
}
示例2: saveFolder
private function saveFolder(\Request $request)
{
$folder_id = $request->getVar('folder_id');
if ($folder_id) {
$folder = new Folder($folder_id);
} else {
$folder = new Folder();
$folder->setFtype($request->getVar('ftype'));
}
$folder->setTitle($request->getVar('title'));
if (empty($folder->title)) {
$this->sendErrorHeader('<div class="alert alert-danger"><i class="fa fa-times fa-lg"></i> May not use an empty folder name.</div>');
return;
}
$db = \Database::newDB();
$db->addTable('folders')->addFieldConditional('title', $folder->title);
$result = $db->selectOneRow();
// if a duplicate row is found (with a different id) then force an error
if (!empty($result) && $result['id'] != $folder_id) {
$this->sendErrorHeader('<div class="alert alert-danger"><i class="fa fa-times fa-lg"></i> A folder with this name already exists</div>');
} else {
$folder->save();
echo $folder->id;
}
}
示例3: updateFolder
/**
* Updates a new folder
*/
function updateFolder()
{
$controllerData =& $this->collectControlerData();
$folderId = $controllerData["folderIdHidden"];
$title = $controllerData["titleText"];
$parentId = $controllerData["parentIdHidden"];
$position = $controllerData["positionText"];
$shortDescription = $controllerData["shortDescriptionText"];
$longDescription = $controllerData["longDescriptionTextarea"];
$classesIdArray = $controllerData["classesIdSelect"];
if ($title == null || $title == "") {
$this->addErrorMessage("title");
}
if ($shortDescription == null || $shortDescription == "") {
$this->addErrorMessage("shortdescription");
}
if ($longDescription == null || $longDescription == "") {
$this->addErrorMessage("longdescription");
}
if (count($classesIdArray) <= 0) {
$this->addErrorMessage("classes");
}
if (count($this->controllerMessageArray) > 0) {
$this->displayUpdateFolderView("addFolder.tpl.php");
return;
}
$folder = new Folder();
$folder->setId($folderId);
$folder->setTitle($title);
$folder->setParentId($parentId);
$folder->setPosition($position);
$folder->setShortDescription($shortDescription);
$folder->setLongDescription($longDescription);
$folderClassesArray = array();
foreach ($classesIdArray as $classId) {
$folderClass = new FolderClass();
$folderClass->setClassID($classId);
$folderClass->setPosition(1);
$folderClass->setIsDefault(0);
array_push($folderClassesArray, $folderClass);
}
$folder->setFolderClasses($folderClassesArray);
$folderService = new FolderService();
$folderService->update($folder);
$this->redirectToReferer();
}