ArticleTypeField::getTopicTypeRootElement PHP 메소드

getTopicTypeRootElement() 공개 메소드

public getTopicTypeRootElement ( ) : string
리턴 string
    public function getTopicTypeRootElement()
    {
        global $g_ado_db;
        if ($this->getType() == self::TYPE_TOPIC && is_null($this->m_rootTopicId)) {
            $queryStr = "SELECT RootTopicId FROM TopicFields WHERE ArticleType = " . $g_ado_db->escape($this->getArticleType()) . " and FieldName = " . $g_ado_db->escape($this->getPrintName());
            $this->m_rootTopicId = $g_ado_db->GetOne($queryStr);
        }
        return $this->m_rootTopicId;
    }

Usage Example

예제 #1
0
            ?>
</textarea>
            <?php 
        } else {
            ?>
              <?php 
            p($text);
            ?>
            <?php 
        }
        ?>
          </li>
        <?php 
    } elseif ($dbColumn->getType() == ArticleTypeField::TYPE_TOPIC) {
        $articleTypeField = new ArticleTypeField($articleObj->getType(), substr($dbColumn->getName(), 1));
        $rootTopicId = $articleTypeField->getTopicTypeRootElement();
        $rootTopic = new Topic($rootTopicId);
        $subtopics = Topic::GetTree($rootTopicId);
        $articleTopicId = $articleData->getProperty($dbColumn->getName());
        ?>
          <li>
            <label><?php 
        echo htmlspecialchars($dbColumn->getDisplayName($articleObj->getLanguageId()));
        ?>
</label>
                <?php 
        if (count($subtopics) == 0) {
            ?>
                <?php 
            putGS('No subtopics available');
            ?>