本文整理汇总了PHP中Section::setId方法的典型用法代码示例。如果您正苦于以下问题:PHP Section::setId方法的具体用法?PHP Section::setId怎么用?PHP Section::setId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Section
的用法示例。
在下文中一共展示了Section::setId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parseRecord
function parseRecord($s_id, $s_name, $s_container, $s_position, $s_created, $s_updated, $l_id, $l_url, $l_comment, $l_created, $l_updated, $l_accessed)
{
global $sections;
global $count;
$index = 0;
while ($index < $count && $sections[$index]->getId() !== $s_id) {
$index++;
}
if ($index === $count) {
$sections[$count] = new Section();
$sections[$count]->setId($s_id)->setName($s_name)->setPosition($s_position)->setCreated($s_created)->setUpdated($s_updated);
for ($i = 0; $i < $count; $i++) {
if ($sections[$i]->getContainer() != null && $sections[$i]->getContainer()->getId() === $s_id) {
$sections[$i]->setContainer($sections[$count]);
$sections[$count]->addSection($sections[$i]);
}
}
if ($s_container != null) {
$i = 0;
while ($i < $count) {
if ($sections[$i]->getId() === $s_container) {
$sections[$count]->setContainer($sections[$i]);
$sections[$i]->addSection($sections[$count]);
break;
}
$i++;
}
if ($i === $count) {
$aux = new Section();
$aux->setId($s_container);
$sections[$count]->setContainer($aux);
}
}
$count++;
}
if ($l_id != null) {
$link = new Link();
$link->setId($l_id)->setUrl($l_url)->setComment($l_comment)->setCreated($l_created)->setUpdated($l_updated)->setAccessed($l_accessed)->setSection($sections[$index]);
$sections[$index]->addLink($link);
}
}
示例2: Section
/**
* Internal function to return a Section object from a row.
* @param $row array
* @return Section
*/
function &_returnSectionFromRow(&$row)
{
$section = new Section();
$section->setId($row['section_id']);
$section->setJournalId($row['journal_id']);
$section->setReviewFormId($row['review_form_id']);
$section->setSequence($row['seq']);
$section->setMetaIndexed($row['meta_indexed']);
$section->setMetaReviewed($row['meta_reviewed']);
$section->setAbstractsNotRequired($row['abstracts_not_required']);
$section->setEditorRestricted($row['editor_restricted']);
$section->setHideTitle($row['hide_title']);
$section->setHideAuthor($row['hide_author']);
$section->setHideAbout($row['hide_about']);
$section->setDisableComments($row['disable_comments']);
$section->setAbstractWordCount($row['abstract_word_count']);
$this->getDataObjectSettings('section_settings', 'section_id', $row['section_id'], $section);
HookRegistry::call('SectionDAO::_returnSectionFromRow', array(&$section, &$row));
return $section;
}
示例3: handleSectionNode
//.........这里部分代码省略.........
foreach ($titles as $locale => $title) {
$section = $sectionDao->getSectionByTitle($title, $journal->getId());
if ($section) {
$sectionId = $section->getId();
if ($foundSectionId) {
if ($foundSectionId != $sectionId) {
// Mismatching sections found. Throw an error.
$errors[] = array('plugins.importexport.native.import.error.sectionTitleMismatch', array('section1Title' => $title, 'section2Title' => $foundSectionTitle, 'issueTitle' => $issue->getIssueIdentification()));
return false;
}
} else {
if ($index > 0) {
// the current title matches, but the prev titles didn't => error
$errors[] = array('plugins.importexport.native.import.error.sectionTitleMatch', array('sectionTitle' => $title, 'issueTitle' => $issue->getIssueIdentification()));
return false;
}
}
$foundSectionId = $sectionId;
$foundSectionTitle = $title;
} else {
if ($foundSectionId) {
// a prev title matched, but the current doesn't => error
$errors[] = array('plugins.importexport.native.import.error.sectionTitleMatch', array('sectionTitle' => $foundSectionTitle, 'issueTitle' => $issue->getIssueIdentification()));
return false;
}
}
$index++;
}
// check abbrevs:
$abbrevSection = null;
$foundSectionId = $foundSectionAbbrev = null;
$index = 0;
foreach ($abbrevs as $locale => $abbrev) {
$abbrevSection = $sectionDao->getSectionByAbbrev($abbrev, $journal->getId());
if ($abbrevSection) {
$sectionId = $abbrevSection->getId();
if ($foundSectionId) {
if ($foundSectionId != $sectionId) {
// Mismatching sections found. Throw an error.
$errors[] = array('plugins.importexport.native.import.error.sectionAbbrevMismatch', array('section1Abbrev' => $abbrev, 'section2Abbrev' => $foundSectionAbbrev, 'issueTitle' => $issue->getIssueIdentification()));
return false;
}
} else {
if ($index > 0) {
// the current abbrev matches, but the prev abbrevs didn't => error
$errors[] = array('plugins.importexport.native.import.error.sectionAbbrevMatch', array('sectionAbbrev' => $sectionAbbrev, 'issueTitle' => $issue->getIssueIdentification()));
return false;
}
}
$foundSectionId = $sectionId;
$foundSectionAbbrev = $abbrev;
} else {
if ($foundSectionId) {
// a prev abbrev matched, but the current doesn't => error
$errors[] = array('plugins.importexport.native.import.error.sectionAbbrevMatch', array('sectionAbbrev' => $foundSectionAbbrev, 'issueTitle' => $issue->getIssueIdentification()));
return false;
}
}
$index++;
}
if (!$section && !$abbrevSection) {
// The section was not matched. Create one.
// Note that because sections are global-ish,
// we're not maintaining a list of created
// sections to delete in case the import fails.
unset($section);
$section = new Section();
$section->setTitle($titles, null);
$section->setAbbrev($abbrevs, null);
$section->setIdentifyType($identifyTypes, null);
$section->setPolicy($policies, null);
$section->setJournalId($journal->getId());
$section->setSequence(REALLY_BIG_NUMBER);
$section->setMetaIndexed(1);
$section->setEditorRestricted(1);
$section->setId($sectionDao->insertSection($section));
$sectionDao->resequenceSections($journal->getId());
}
if (!$section && $abbrevSection) {
unset($section);
$section =& $abbrevSection;
}
// $section *must* now contain a valid section, whether it was
// found amongst existing sections or created anew.
// Handle custom ordering, if necessary.
if ($sectionIndex !== null) {
$sectionDao->insertCustomSectionOrder($issue->getId(), $section->getId(), $sectionIndex);
}
$hasErrors = false;
for ($index = 0; $node = $sectionNode->getChildByName('article', $index); $index++) {
if (!NativeImportDom::handleArticleNode($journal, $node, $issue, $section, $article, $publishedArticle, $articleErrors, $user, $isCommandLine, $dependentItems)) {
$errors = array_merge($errors, $articleErrors);
$hasErrors = true;
}
}
if ($hasErrors) {
return false;
}
return true;
}
示例4: addSection
public function addSection($title)
{
$section = new Section($this->addSubElement("section"));
$section->setId("section_" . $this->getNewSectionId());
$section->setTitle($title);
$section->setPublished(false);
$this->saveDOM();
return $section;
}
示例5: getAllSection
function getAllSection()
{
$key = 'section';
$collection = CacheManager::get($key, TRUE);
if ($collection) {
return $collection;
}
$collection = new Collection();
$this->connect();
$result = $this->conn->query("CALL sp_get_all_section()");
if ($result) {
//$row = $result->fetch_assoc();
while ($obj = $result->fetch_object()) {
$section = new Section();
$section->setId($obj->Section_id);
$section->setName($obj->Section_name);
$collection->addItem($section, $obj->Section_id);
}
$result->close();
// for fetch_object()
}
//$result->free_result(); // for fetch_assoc()
$this->close();
CacheManager::set($key, $collection, TRUE);
return $collection;
}