ContextBox::__construct PHP Method

__construct() public method

public __construct ( $p_id = null, $p_article_no = null )
    public function __construct($p_id = null, $p_article_no = null)
    {
        parent::__construct($this->m_columnNames);
        if (is_numeric($p_id) && $p_id > 0) {
            $this->m_data['id'] = $p_id;
            if ($this->keyValuesExist()) {
                $this->fetch();
            }
        } else {
            if (is_numeric($p_article_no) && $p_article_no > 0) {
                $this->m_data['fk_article_no'] = $p_article_no;
                $this->m_keyColumnNames = array('fk_article_no');
                $this->fetch();
                $this->m_keyColumnNames = array('id');
            }
        }
        if (!$this->exists()) {
            $this->create($p_article_no);
        }
    }