本文整理汇总了PHP中Folder::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Folder::getId方法的具体用法?PHP Folder::getId怎么用?PHP Folder::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Folder
的用法示例。
在下文中一共展示了Folder::getId方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testDelete
public function testDelete()
{
$folder = new Folder();
$folder->setId(3);
$sql = 'DELETE FROM `*PREFIX*news_folders` WHERE `id` = ?';
$arguments = array($folder->getId());
$sql2 = 'DELETE FROM `*PREFIX*news_feeds` WHERE `folder_id` = ?';
$sql3 = 'DELETE FROM `*PREFIX*news_items` WHERE `feed_id` NOT IN ' . '(SELECT `feeds`.`id` FROM `*PREFIX*news_feeds` `feeds`)';
$arguments2 = array($folder->getId());
$this->setMapperResult($sql, $arguments);
$this->setMapperResult($sql2, $arguments2);
$this->setMapperResult($sql3);
$this->folderMapper->delete($folder);
}
示例2: getFolderCollection
public function getFolderCollection($where)
{
global $dRep;
$where = $this->sqlBuilder->createWhere($where, '');
$sql = "SELECT * FROM ink_folders WHERE {$where} ORDER BY folderOrder;";
$data = $this->runManyQuery($sql);
$folders = array();
foreach ($data as $index => $row) {
$folder = new Folder();
$properties = array('id' => $row['folderId'], 'name' => $row['folderName'], 'site' => $row['siteId'], 'parent' => $dRep->getFolder($row['parentId']), 'files' => $dRep->getFileCollection(array('folder' => $row['folderId'])), 'order' => $row['folderOrder']);
$folder->setProperties($properties);
$this->folders[$folder->getId()] = $folder;
$folders[] = $folder;
}
return $folders;
}
示例3: handleRoadmaps
public function handleRoadmaps()
{
$default_folders = array();
$conn = Doctrine_Manager::getInstance()->connection();
$roadmaps = $conn->execute("SELECT id, user_id from `roadmap` WHERE folder_id is NULL")->fetchAll();
foreach ($roadmaps as $roadmap) {
if (!array_key_exists($roadmap['user_id'], $default_folders)) {
$folder = $conn->execute("SELECT id from `folder` WHERE `user_id` = :user_id and `type` = '" . Folder::TYPE_ROADMAP . "' and `deletable` = 0 LIMIT 1;", array(':user_id' => $roadmap['user_id']))->fetchAll();
if (count($folder)) {
$default_folders[$roadmap['user_id']] = $folder[0]['id'];
} else {
$folder = new Folder();
$folder->setName('Default');
$folder->setUserId($roadmap['user_id']);
$folder->setDeletable(0);
$folder->setType(Folder::TYPE_ROADMAP);
$folder->save();
$default_folders[$roadmap['user_id']] = $folder->getId();
}
}
$conn->execute("UPDATE `roadmap` SET `folder_id` = :folder_id WHERE id = :id", array(':folder_id' => $default_folders[$roadmap['user_id']], ':id' => $roadmap['id']));
}
}
示例4: delete
/**
* @brief Delete the folder and all its feeds from the database
* @param folder the folder to be deleted (an instance of OCA\News\Folder)
* @returns true if the folder has been deleted, false if an error occurred
*/
public function delete(Folder $folder)
{
$folderid = $folder->getId();
return deleteById(folderid);
}
示例5: testGetId
public function testGetId()
{
assertThat($this->folder->getId(), is($this->folderId));
}
示例6:
/**
* This is the constructor for the KTAPI_Folder.
*
* @author KnowledgeTree Team
* @access private
* @param KTAPI $ktapi
* @param Folder $folder
* @return KTAPI_Folder
*/
function KTAPI_Folder(&$ktapi, &$folder)
{
$this->ktapi =& $ktapi;
$this->folder =& $folder;
$this->folderid = $folder->getId();
}