Owl\Repositories\Eloquent\TagRepository::updateFlowFlag PHP Method

updateFlowFlag() public method

Update a tag's flow_flag.
public updateFlowFlag ( integer $tag_id, boolean $flag = true ) : Illuminate\Database\Eloquent\Model
$tag_id integer
$flag boolean
return Illuminate\Database\Eloquent\Model
    public function updateFlowFlag($tag_id, $flag = true)
    {
        $tag = $this->getById($tag_id);
        if (!$tag) {
            return false;
        }
        $flow = $flag ? self::FLOW_FLAG_ON : self::FLOW_FLAG_OFF;
        $tag->flow_flag = $flow;
        if ($tag->save()) {
            return $tag;
        } else {
            return false;
        }
    }