Habari\Post::__construct PHP Method

__construct() public method

Constructor for the Post class.
public __construct ( array $paramarray = [] )
$paramarray array an associative array of initial Post field values.
    public function __construct($paramarray = array())
    {
        // Defaults
        $this->fields = array_merge(self::default_fields(), $this->fields);
        parent::__construct($paramarray);
        if (isset($this->fields['tags'])) {
            $this->tags_object = Terms::parse($this->fields['tags'], '\\Habari\\Tag', Tags::vocabulary());
            unset($this->fields['tags']);
        }
        $this->exclude_fields('id');
        /* $this->fields['id'] could be null in case of a new post. If so, the info object is _not_ safe to use till after set_key has been called. Info records can be set immediately in any other case. */
    }