Habari\Post::setstatus PHP Метод

setstatus() приватный Метод

Sets the status for a post, given a string or integer.
private setstatus ( string | integer $value ) : integer | boolean
$value string | integer the status to set it to
Результат integer | boolean the status of the post, or false if the new status isn't valid
    private function setstatus($value)
    {
        $statuses = Post::list_post_statuses();
        $fieldname = isset($this->fields['status']) ? 'newfields' : 'fields';
        if (is_numeric($value) && in_array($value, $statuses)) {
            return $this->{"{$fieldname}"}['status'] = $value;
        } elseif (array_key_exists($value, $statuses)) {
            return $this->{"{$fieldname}"}['status'] = Post::status($value);
        }
        return false;
    }