ArticleType::ArticleType PHP Method

ArticleType() public method

An article type is a dynamic table that is created for an article to allow different publications to display their content in different ways.
public ArticleType ( string $p_articleType )
$p_articleType string
    public function ArticleType($p_articleType)
    {
        $cacheService = \Zend_Registry::get('container')->getService('newscoop.cache');
        $cacheKey = $cacheService->getCacheKey(array('ArticleTypeField', $p_articleType), 'article_type');
        if ($cacheService->contains($cacheKey)) {
            $this->m_metadata = $cacheService->fetch($cacheKey);
        } else {
            $this->m_metadata = new ArticleTypeField($p_articleType, 'NULL');
            $cacheService->save($cacheKey, $this->m_metadata);
        }
        $this->m_name = $this->m_metadata->getArticleType();
        $this->m_dbTableName = 'X' . $this->m_name;
        if ($this->m_metadata->exists()) {
            // Get user-defined values.
            $this->getUserDefinedColumns();
            foreach ($this->m_dbColumns as $columnMetaData) {
                $this->m_columnNames[] = $columnMetaData->getName();
            }
        }
    }