Set the comments

@param string

@return Job
163051
public function setComments($comments)
    {
        if (is_array($comments)) {
            $comments = implode($comments, ' ');
        }

        $this->comments = $comments;

        return $this;
    }
1217204
public function ReplyForm($comment)
    {
        // Enables multiple forms with different names to use the same handler
        $form = $this->CommentsForm();
        $form->setName('ReplyForm_' . $comment->ID);
        $form->setHTMLID(null);
        $form->addExtraClass('reply-form');

        // Load parent into reply form
        $form->loadDataFrom([
            'ParentCommentID' => $comment->ID
        ]);

        // Customise action
        $form->setFormAction($this->Link('reply', $comment->ID));

        $this->extend('updateReplyForm', $form);

        return $form;
    }
262991
def _set_comment(self, section, comment, key=None):
        

        if '\n' in comment:
            comment = '\n# '.join(comment.split('\n'))
        comment = '# ' + comment

        if key:
            self._comments[(section, key)] = comment
        else:
            self._comments[section] = comment
426587
public function setComments(ArrayCollection $comments)
    {
        /** @var \Icap\BlogBundle\Entity\Comment[] $comments */
        foreach ($comments as $comment) {
            $comment->setPost($this);
        }

        $this->comments = $comments;

        return $this;
    }
282478
public function addComment(string $comment) : bool
    {
        if (is_string($comment)) {
            $this->comments[] = $comment;
        }

        return true;
    }
195839
public function setComment($comment)
    {
        if (($comment !== null) && !is_string($comment)) {
            throw SchemaException::invalidColumnComment($this->getName());
        }

        $this->comment = $comment;
    }
1205557
def set_comments(self):
        """"""
        try:
            self.comments = self.soup.find('comments').string
        except AttributeError:
            self.comments = None
355733
public function addComment(\Innova\CollecticielBundle\Entity\Comment $comments)
    {
        $this->comments[] = $comments;

        return $this;
    }
643486
def set_comment(self, key_name, new_comment):
        """"""
        kf = self.dct[key_name]
        kf['comment'] = new_comment
1208842
protected function appendComment($comment)
    {
        $comment[1] = substr(preg_replace(['/^\s+/m', '/^(.)/m'], ['', ' \1'], $comment[1]), 1);

        $this->env->comments[] = $comment;
    }
1291695
function setServerComment($comment, $multicall = false)
    {
        if (!is_string($comment)) {
            throw new InvalidArgumentException('comment = ' . print_r($comment, true));
        }

        return $this->execute(ucfirst(__FUNCTION__), array($comment), $multicall);
    }
177958
public function addComment()
    {
        $userIsAllowed = $this
            ->userCredentialsProvider
            ->isAllowed();
        if (!$userIsAllowed) {
            return new JsonResponse([
                'status' => 'Error',
                'message' => 'The user is not allowed to post a comment',
            ], 401);
        }

        $sourceUUID = $this->getSourceUUID();
        if (empty($sourceUUID)) {
            return new JsonResponse([
                'status' => 'Error',
                'message' => 'Source UUID header must be defined',
            ], 400);
        }

        $authorUUID = $this
            ->userCredentialsProvider
            ->getUUID();
        if (empty($authorUUID)) {
            return new JsonResponse([
                'status' => 'Error',
                'message' => 'Author UUID header must be defined',
            ], 400);
        }

        $now = new DateTime();
        $postParameterBag = $this
            ->request
            ->request;

        $authorIsModerator = $this->userCredentialsProvider->isModerator();
        $authorRole = $authorIsModerator
            ? Author::ROLE_MODERATOR
            : Author::ROLE_USER;

        $state = $authorIsModerator
            ? State::APPROVED
            : State::NEW;

        $comment = Comment::createFromArray([
            'id' => bin2hex(random_bytes(32)),
            'source' => $sourceUUID,
            'author_uuid' => $authorUUID,
            'author_name' => $this->userCredentialsProvider->getName(),
            'author_email' => $this->userCredentialsProvider->getEmail(),
            'author_avatar' => $this->userCredentialsProvider->getAvatar(),
            'author_role' => $authorRole,
            'content' => $postParameterBag->get('content'),
            'created_at' => $now->format(DATE_ATOM),
            'state' => $state,
            'rating' => (int) $postParameterBag->get('rating', 0),
        ]);

        $this
            ->commentRepository
            ->addComment($comment);
        $this->flushRepository();
        $comment->setEditable(true);

        return new JsonResponse([
            'status' => 'OK',
            'comment' => $comment->toArray(),
            'user' => $this->userCredentialsProvider->toArray(),
        ], 200);
    }
1188776
public function addComment($comment)
    {
        if(Yii::$app->params['commentNeedApproval'])
            $comment->status = Comment::STATUS_PENDING;
        else
            $comment->status = Comment::STATUS_APPROVED;
        // set model and parent_id (parent model ID)
        $comment->model = self::COMMENT_FOR;
        $comment->parent_id = $this->id;
        $comment->user_id = \Yii::$app->user->id;
        if($comment->thread == '-')
            // set new thread
            $comment->thread = time() . uniqid();
        else
            // unmark previous comment
            Yii::$app->db->createCommand("UPDATE {{%comment}} SET last=0 WHERE thread='{$comment->thread}' AND last=1")->execute();
        // mark only last comment in a thread
        $comment->last = 1;
        if($comment->save()) {
            if(Yii::$app->params['notifyResponsibleAboutComment'])
                $comment->trigger(Comment::EVENT_JUST_ADDED);
            $comment->content = '';
            return true;
        } else
            return false;
    }
329316
public function addComment(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Comment\Comment $comment)
    {
        $this->comments[] = $comment;

        return $this;
    }
1303783
public function addComment($user, string $comment) : Comment
    {
        return $this->comments()->create([
            'user_id' => $user->id,
            'comment' => $comment,
        ]);
    }
509514
public function add($comment)
    {
        $comments = $this->session->get('comments', []);
        $comments[] = $comment;
        $this->session->set('comments', $comments);
    }
1184954
public function comments(string $commit)
    {
        return new Comments($this->getHttpClient(), $this->username, $this->repo, $commit);
    }