Template::Template PHP Method

Template() public method

A template is an HTML file with Campsite parser tags inside.
public Template ( $p_templateIdOrName = null )
    public function Template($p_templateIdOrName = null)
    {
        parent::DatabaseObject($this->m_columnNames);
        if (is_numeric($p_templateIdOrName)) {
            $this->m_data['Id'] = $p_templateIdOrName;
        } elseif (is_string($p_templateIdOrName)) {
            $this->m_data['Name'] = $p_templateIdOrName;
            $this->m_keyColumnNames = array('Name');
        }
        if ($this->keyValuesExist()) {
            $this->fetch();
        }
    }

Usage Example

 /**
  * Constructor
  *
  * Please do not call directly.  Use Template::construct_template().
  *
  * @param string $template_id the template ID
  *
  */
 function PHP_Template($template_id)
 {
     //FIXME: find a way to test that this is ONLY ever called
     //       from parent's construct_template() method (I doubt it
     //       is worth the trouble to parse the current stack trace)
     //        if (???)
     //            trigger_error('Please do not use default PHP_Template() constructor.  Instead, use Template::construct_template().', E_USER_ERROR);
     parent::Template($template_id);
 }
All Usage Examples Of Template::Template