Notify Members of the post there is a new comment.

@param Comment $comment
160226
public function onAfterPostComment(Comment $comment)
    {
        $parent = $comment->Parent();

        if (!$parent || !$parent->hasMethod('notificationRecipients')) {
            return;
        }

        // Ask parent to submit all recipients
        $recipients = $parent->notificationRecipients($comment);

        foreach ($recipients as $recipient) {
            $this->notifyCommentRecipient($comment, $parent, $recipient);
        }
    }
55554
public void updateComment(int commentId, CommentUpdate comment) {
		getResourceFactory().getApiResource("/comment/" + commentId)
				.entity(comment, MediaType.APPLICATION_JSON_TYPE).put();
	}
425223
public function setComment( $comment )
	{
		if ( $comment == $this->getComment() ) { return; }

		$this->_values['comment'] = (string) $comment;

		$this->_modified = true;
	}
284418
def addcomment(self, order_increment_id,
            status, comment=None, notify=False):
        
        if comment is None:
            comment = ""
        return bool(self.call(
                'sales_order.addComment',
                [order_increment_id, status, comment, notify]
            )
        )
976628
public function removeComment(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Comment\Comment $comment)
    {
        return $this->comments->removeElement($comment);
    }
120115
public function updateComment()
    {
        $newComment = $_POST['comment'] ?? null;
        $commentId = $_POST['commentId'] ?? null;

        if (!$newComment || !$commentId || !$comment = get_comment($commentId)) {
            wp_send_json_error('Missing variables');
        }

        if (!current_user_can('edit_comment', $comment->comment_ID) && !($comment->user_id == get_current_user_id())) {
            wp_send_json_error('Missing authorization');
        }

        // Validate nonce
        if (!check_ajax_referer("update-comment_$comment->comment_ID", 'nonce', false)) {
            wp_send_json_error('Nonce failed');
        }

        $comment->comment_content = $newComment;
        if (wp_update_comment((array) $comment)) {
            wp_send_json_success('Update was successful');
        }

        wp_send_json();
    }
1133994
public function addComment(\Haven\CmsBundle\Entity\Comment $comment)
    {
        $comment->setContent($this);
        $this->comments[] = $comment;

        return $this;
    }
63739
public function dispatchCommentCreateEvent(Post $post, Comment $comment)
    {
        $event = new LogCommentCreateEvent($post, $comment, $this->translator);

        return $this->dispatch($event);
    }
970328
public function afterUpdatingComment( $comment, $notified, $time )
    {
        $user = eZUser::fetch( $comment->attribute( 'user_id' ) );

        // if notified is true, add subscription, else cleanup the subscription on the user and content
        $contentID = $comment->attribute( 'contentobject_id' );
        $languageID = $comment->attribute( 'language_id' );
        $subscriptionType = 'ezcomcomment';
        if ( !is_null( $notified ) )
        {
            $subscriptionManager = ezcomSubscriptionManager::instance();
            if ( $notified === true )
            {
                //add subscription but not send activation
                try
                {
                $subscriptionManager->addSubscription( $comment->attribute( 'email' ),
                                                       $user,
                                                       $contentID,
                                                       $languageID,
                                                       $subscriptionType,
                                                       $time,
                                                       false );
                }
                catch ( Exception $e )
                {
                    eZDebug::writeError( $e->getMessage(), __METHOD__ );
                    switch ( $e->getCode() )
                    {
                        case ezcomSubscriptionManager::ERROR_SUBSCRIBER_DISABLED:
                            return 'The subscriber is disabled.';
                        default:
                            return false;
                    }
                }
            }
            else
            {
                $subscriptionManager->deleteSubscription( $comment->attribute( 'email' ),
                                                          $comment->attribute( 'contentobject_id' ),
                                                          $comment->attribute( 'language_id' ) );
            }
        }
        //3. update queue. If there is subscription, add one record into queue table
        // if there is subcription on this content, add one item into queue
        if ( ezcomSubscription::exists( $contentID, $languageID,  $subscriptionType ) )
        {
            $notification = ezcomNotification::create();
            $notification->setAttribute( 'contentobject_id', $comment->attribute( 'contentobject_id' ) );
            $notification->setAttribute( 'language_id', $comment->attribute( 'language_id' ) );
            $notification->setAttribute( 'comment_id', $comment->attribute( 'id' ) );
            $notification->store();
            eZDebugSetting::writeNotice( 'extension-ezcomments', 'There are subscriptions, added an update notification to the queue.', __METHOD__ );
        }
        else
        {
            // todo: if there is no subscription on this content, consider to clean up the queue
        }
        return true;
    }
814047
public function setComment(string $comment): void
    {
        $this->desc = '';
        $this->tags = [];
        $this->comment = $comment;

        $this->parseComment($comment);
    }
493637
public function removeComment(\Innova\CollecticielBundle\Entity\Comment $comments)
    {
        $this->comments->removeElement($comments);
    }
242709
public function notificationTemplate($comment, $recipient)
    {
        $template = $this->owner->config()->default_notification_template;

        $this->owner->invokeWithExtensions('updateNotificationTemplate', $template, $comment, $recipient);

        return $template;
    }
1084355
public function addComment(\Innova\CollecticielBundle\Entity\CommentRead $comments)
    {
        $this->comments[] = $comments;

        return $this;
    }
971566
public function updateComment( $comment, $user=null, $time = null , $notified = null )
    {
        if ( $time === null )
        {
            $time = time();
        }

        $beforeUpdating = $this->beforeUpdatingComment( $comment, $notified, $time );
        if ( $beforeUpdating !== true )
        {
            return $beforeUpdating;
        }
        $comment->store();

        $afterUpdating = $this->afterUpdatingComment( $comment, $notified, $time );
        if ( $afterUpdating !== true )
        {
            return $afterUpdating;
        }
        return true;
    }
327311
public function addComment($creditmemoIncrementId, $comment = null, $notifyCustomer = null, $includeComment = null)
    {
        return $this->__createAction('order_creditmemo.addComment', func_get_args());
    }
762489
public function setComment($comment)
    {
        $thisCVID = $this->getVersionID();
        $comment = ($comment != null) ? $comment : "Version {$thisCVID}";
        $v = array(
            $comment,
            $thisCVID,
            $this->cID,
        );
        $app = Facade::getFacadeApplication();
        $db = $app->make('database')->connection();
        $q = "update CollectionVersions set cvComments = ? where cvID = ? and cID = ?";
        $db->executeQuery($q, $v);
        $this->cvComments = $comment;
    }
121636
public function setComment($comment)
    {
        if ( ! is_string($comment))
        {
            throw new InvalidArgumentException(
                'Expected a string, but got '.gettype($comment)
            );
        }

        $this->comment = $comment;
    }