private function spaceReplyCase4Flow(DoctorPatientRef $ref, $options, $attachmentIds, $user, $content) 
    {/*{{{*/
        if(false == $ref->isSpaceCanPost())
        {
            $this->setErrorCode(842);
            return 0;
        }
        if ($ref->isClosePost()) 
        {
            DoctorPatientPostClient::getInstance()->switchPatientPostCan($ref->space->user->id, $ref->id);
        }
        if($ref->replyLimitationIsApproaching())
        {
            $option['removeReplyLimitation']  = isset($options['removeReplyLimitation']) ? $options['removeReplyLimitation'] : 0;
        }
        if(isset($option['removeReplyLimitation']) && $option['removeReplyLimitation'])
        {
            if($ref->space->isChargeOpened())
            {
                //当是收费咨询的时候,取消remove参数。因为传0或者1都会在addPost再次改变次数
                unset($option['removeReplyLimitation']);
                FlowClient::getInstance()->addFreeServcieCardBySystem($ref);
            }
        }

        //加入默认患友会
        if($user->id == $ref->space->user->id
        && $ref->space->isPatientOpened()
            && $ref->isReGroupMember() == false)
        {
            FlowClient::getInstance()->addUserToDefaultReGroup($ref->id, $user->id);
        }

        $attachmentIds = explode(',', $attachmentIds);
        $option['attachmentIds'] = $attachmentIds;
        if(isset($options['isPrivated']) && $options['isPrivated'])
        {
            $option['isPrivated'] = true;
        }
        $post = DoctorPatientPostClient::getInstance()->addPost($ref->id, $user->id, $content, $option);
        DBC::requireFalse($post->isNull(), '系统繁忙,请稍后重试');
        if (false == $post->isNull())
        {
            ScoreClient::getInstance()->replyForFlow($user, $ref);
        }
        try{
            FlowClient::getInstance()->addLog($ref, $user, DoctorPatientLog::TYPE_SYSTEM_LOG, 'CaseDataBucket::spaceReplyCase', $post);
        }catch(Exception $ex)
        {}
        return $post;
    }/*}}}*/