ArticleTypeField::getType PHP Method

getType() public method

public getType ( ) : string
return string
    public function getType()
    {
        return $this->m_data['field_type'];
    }

Usage Example

Ejemplo n.º 1
0
 public function setProperty($p_dbColumnName, $p_value, $p_commit = true, $p_isSql = false)
 {
     if (!in_array($p_dbColumnName, $this->m_columnNames)) {
         return false;
     }
     $articleField = new ArticleTypeField($this->m_articleTypeName, substr($p_dbColumnName, 1));
     if ($articleField->getType() == ArticleTypeField::TYPE_BODY) {
         // Replace <span class="subhead"> ... </span> with <!** Title> ... <!** EndTitle>
         $text = preg_replace_callback("/(<\\s*span[^>]*class\\s*=\\s*[\"']campsite_subhead[\"'][^>]*>|<\\s*span|<\\s*\\/\\s*span\\s*>)/i", array('ArticleData', "TransformSubheads"), $p_value);
         // Replace <a href="campsite_internal_link?IdPublication=1&..." ...> ... </a>
         // with <!** Link Internal IdPublication=1&...> ... <!** EndLink>
         $text = preg_replace_callback("/(<\\s*a\\s*(((href\\s*=\\s*[\"'](\\/campsite\\/)?campsite_internal_link[?][\\w&=;]*[\"'])|(\\w+\\s*=\\s*['\"][_\\w]*['\"]))+[\\s]*)*[\\s\\w\"']*>)|(<\\s*\\/a\\s*>)/i", array('ArticleData', "TransformInternalLinks"), $text);
         // Replace <img id=".." src=".." alt=".." title=".." align="..">
         // with <!** Image [image_template_id] align=".." alt=".." sub="..">
         $idAttr = "(id\\s*=\\s*\"[^\"]*\")";
         $srcAttr = "(src\\s*=\\s*\"[^\"]*\")";
         $altAttr = "(alt\\s*=\\s*\"[^\"]*\")";
         $subAttr = "(title\\s*=\\s*\"[^\"]*\")";
         $alignAttr = "(align\\s*=\\s*\"[^\"]*\")";
         $widthAttr = "(width\\s*=\\s*\"[^\"]*\")";
         $heightAttr = "(height\\s*=\\s*\"[^\"]*\")";
         $otherAttr = "(\\w+\\s*=\\s*\"[^\"]*\")*";
         $pattern = "/<\\s*img\\s*(({$idAttr}|{$srcAttr}|{$altAttr}|{$subAttr}|{$alignAttr}|{$widthAttr}|{$heightAttr}|{$otherAttr})\\s*)*\\/>/i";
         $p_value = preg_replace_callback($pattern, array($this, "transformImageTags"), $text);
     }
     if ($articleField->getType() == ArticleTypeField::TYPE_SWITCH) {
         return parent::setProperty($p_dbColumnName, (int) ($p_value == 'on'), $p_commit);
     }
     return parent::setProperty($p_dbColumnName, $p_value, $p_commit, $p_isSql);
 }
All Usage Examples Of ArticleTypeField::getType