(non-PHPdoc)
@see extension/ezcomments/classes/ezcomFormTool#fillObject($comment, $fieldNames)
496541
public function fillObject( $comment, $fieldNames = null )
    {
        if ( is_null( $fieldNames ) )
        {
            $fieldNames = array();
            foreach ( $this->fields as $field => $fieldSetup )
            {
                if( $field != 'email' )
                {
                    $fieldNames[] = $field;
                }
            }
        }
        parent::fillObject( $comment, $fieldNames );
    }
687787
public static function add_comment(comment $comment) {
        global $DB;
        $comment->id = null;
        return $DB->insert_record('assignfeedback_editpdf_cmnt', $comment);
    }
755546
public void addComment(Comment comment) {
        if (comments == null || comments.size() == 0) {
            comments = new ArrayList<Comment>();
        }

        comments.add((CommentImpl) comment);
    }
261720
public function updateOrFail(Comment $comment)
    {
        $status = $this->update($comment);

        if (is_wp_error($status)) {
            throw new QueryException("Posttype [{$this->slug}] could not update post with id: {$id}.");
        }

        return $status;
    }
731658
public function setComments($comments)
    {
        $this->comments = [];
        if (!is_array($comments)) {
            $comments = [$comments];
        }
        foreach ($comments as $comment) {
            $this->addComment($comment);
        }

        return $this;
    }
413648
public function serialize(ResourceComment $comment, array $options = [])
    {
        $serialized = [
            'id' => $comment->getUuid(),
            'content' => $comment->getContent(),
            'user' => $comment->getUser() ? $this->userSerializer->serialize($comment->getUser(), [Options::SERIALIZE_MINIMAL]) : null,
            'creationDate' => $comment->getCreationDate() ? DateNormalizer::normalize($comment->getCreationDate()) : null,
            'editionDate' => $comment->getEditionDate() ? DateNormalizer::normalize($comment->getEditionDate()) : null,
        ];

        return $serialized;
    }
788390
public function setSubscriptionComment($comment)
    {
        if (strlen($comment) > 200) {
            throw new InvalidArgumentException("Subscription comment cannot be longer than 200 characters");
        }
        if (preg_match('/[^a-zA-Z0-9_ -]/', $comment)) {
            throw new InvalidArgumentException("Subscription comment cannot contain special characters");
        }
        $this->parameters['sub_comment'] = $comment;
    }
1208842
protected function appendComment($comment)
    {
        $comment[1] = substr(preg_replace(['/^\s+/m', '/^(.)/m'], ['', ' \1'], $comment[1]), 1);

        $this->env->comments[] = $comment;
    }
1181151
public function fromComment($comment, $context = null)
    {
        if ($context === null) {
            $context = new Context(['comment' => $comment]);
        } else {
            $context->comment = $comment;
        }
        try {
            self::$context = $context;
            if ($context->is('annotations') === false) {
                $context->annotations = [];
            }
            $comment = preg_replace_callback(
                '/^[\t ]*\*[\t ]+/m',
                function ($match) {
                    // Replace leading tabs with spaces.
                    // Workaround for http://www.doctrine-project.org/jira/browse/DCOM-255
                    return str_replace("\t", ' ', $match[0]);
                },
                $comment
            );
            $annotations = $this->docParser->parse($comment, $context);
            self::$context = null;
            return $annotations;
        } catch (Exception $e) {
            self::$context = null;
            if (preg_match('/^(.+) at position ([0-9]+) in ' . preg_quote((string)$context, '/') . '\.$/', $e->getMessage(), $matches)) {
                $errorMessage = $matches[1];
                $errorPos = (int)$matches[2];
                $atPos = strpos($comment, '@');
                $context->line += substr_count($comment, "\n", 0, $atPos + $errorPos);
                $lines = explode("\n", substr($comment, $atPos, $errorPos));
                $context->character = strlen(array_pop($lines)) + 1; // position starts at 0 character starts at 1
                Logger::warning(new Exception($errorMessage . ' in ' . $context, $e->getCode(), $e));
            } else {
                Logger::warning($e);
            }
            return [];
        }
    }
716626
public function addComment(NodeInterface $commentableNode, CommentDtoInterface $comment)
    {
        if (!$this->isCommentableNode($commentableNode)) {
            throw new InvalidNodeTypeException('The commentable node type should implement the mixin '.self::COMMENTABLE_NODE_TYPE, 1536244558);
        }

        $this->createNode($commentableNode->getNode('comments'), $comment);
    }
158338
public function serialize(Post $post, array $options = [], array $comments = [])
    {
        //serialize comments
        if (isset($options[CommentSerializer::INCLUDE_COMMENTS])) {
            if ($this->hasOption(CommentSerializer::FETCH_COMMENTS, $options)) {
                $comments = $this->serializePostComments($post, $options);
            }
        }
        $commentsNumber = $post->countComments();
        $commentsNumberUnpublished = $post->countUnpublishedComments();

        return [
            'id' => $post->getUuid(),
            'slug' => $post->getSlug(),
            'title' => $post->getTitle(),
            'content' => isset($options['abstract']) && $options['abstract'] ? $post->getAbstract() : $post->getContent(),
            'abstract' => $this->isAbstract($post, $options),
            'creationDate' => $post->getCreationDate() ? DateNormalizer::normalize($post->getCreationDate()) : new \DateTime(),
            'modificationDate' => $post->getModificationDate() ? DateNormalizer::normalize($post->getModificationDate()) : null,
            'publicationDate' => $post->getPublicationDate() ? DateNormalizer::normalize($post->getPublicationDate()) : DateNormalizer::normalize($post->getCreationDate()),
            'viewCounter' => $post->getViewCounter(),
            'author' => $post->getAuthor() ? $this->userSerializer->serialize($post->getAuthor(), [Options::SERIALIZE_MINIMAL]) : null,
            'authorName' => $post->getAuthor() ? $post->getAuthor()->getFullName() : null,
            'authorPicture' => $post->getAuthor()->getPicture(),
            'tags' => $this->serializeTags($post),
            'comments' => $comments,
            'commentsNumber' => $commentsNumber,
            'commentsNumberUnpublished' => $commentsNumberUnpublished,
            'isPublished' => $post->isPublished(),
            'status' => $post->isPublished(false),
            'pinned' => $post->isPinned(),
        ];
    }
281570
public function fill($fields = [])
    {
        $url = self::resolveFullUrl([$this->id]);

        if(isset($this->properties['fillable_fields'])) {
            $fields = $this->properties['fillable_fields'];
        }

        foreach ($fields as $index => $field) {
            if (!is_array($field)) {
                continue;
            }

            unset($fields[$index]);

            if (!isset($field['name']) || !isset($field['value'])) {
                continue;
            }

            $name = $field['name'];
            $value = $field['value'];
            $type = isset($field['type']) ? $field['type'] : '';

            if ($type === self::TYPE_CHECKBOX) {
                $value = intval(boolval($value));
            }

            $fields[$name] = $value;
        }

        return static::post($this->client, $url, [
            'json' => [
                'fillable_fields' => $fields
            ]
        ]);
    }
1054074
public function add($fieldName)
    {
        if (strpos($fieldName, '[') === false && strpos($fieldName, ']') === false && in_array('*', $this->fieldList)) {
            $this->fieldList = array_diff($this->fieldList, ['*']);
        }

        $this->fieldList[] = $fieldName;
    }
527841
protected function prepare_links( $comment ) {
		$links = array(
			'self' => array(
				'href' => rest_url( sprintf( '%s/%s/%d', $this->namespace, $this->rest_base, $comment->comment_ID ) ),
			),
			'collection' => array(
				'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ),
			),
		);

		if ( 0 !== (int) $comment->user_id ) {
			$links['author'] = array(
				'href'       => rest_url( 'wp/v2/users/' . $comment->user_id ),
				'embeddable' => true,
			);
		}

		if ( 0 !== (int) $comment->comment_post_ID ) {
			$post = $this->get_post( $comment->comment_post_ID );
			if ( ! empty( $post->ID ) ) {
				$obj = get_post_type_object( $post->post_type );
				$base = ! empty( $obj->rest_base ) ? $obj->rest_base : $obj->name;

				$links['up'] = array(
					'href'       => rest_url( 'wp/v2/' . $base . '/' . $comment->comment_post_ID ),
					'embeddable' => true,
					'post_type'  => $post->post_type,
				);
			}
		}

		if ( 0 !== (int) $comment->comment_parent ) {
			$links['in-reply-to'] = array(
				'href'       => rest_url( sprintf( '%s/%s/%d', $this->namespace, $this->rest_base, $comment->comment_parent ) ),
				'embeddable' => true,
			);
		}

		// Only grab one comment to verify the comment has children.
		$comment_children = $comment->get_children( array( 'number' => 1, 'count' => true ) );
		if ( ! empty( $comment_children ) ) {
			$args = array( 'parent' => $comment->comment_ID );
			$rest_url = add_query_arg( $args, rest_url( $this->namespace . '/' . $this->rest_base ) );

			$links['children'] = array(
				'href' => $rest_url,
			);
		}

		return $links;
	}
127175
public function setComment($comment)
    {
        $returnValue = (bool) false;
        $this->removePropertyValues($this->getProperty(OntologyRdfs::RDFS_COMMENT));
        $this->setPropertyValue($this->getProperty(OntologyRdfs::RDFS_COMMENT), $comment);
        $this->comment = $comment;
        return (bool) $returnValue;
    }
426587
public function setComments(ArrayCollection $comments)
    {
        /** @var \Icap\BlogBundle\Entity\Comment[] $comments */
        foreach ($comments as $comment) {
            $comment->setPost($this);
        }

        $this->comments = $comments;

        return $this;
    }
1019758
public function addComment(string $comment) : TomlBuilder
    {
        $this->append($this->dumpComment($comment), true);

        return $this;
    }