<commit_before><?php

/*
 * This file is part of the FOSCommentBundle package.
 *
 * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace App\Entity\Comment;

use DateTime;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\MappedSuperclass
 */
abstract class AbstractThread implements ThreadInterface
{
    /**
     * Id, a unique string that binds the comments together in a thread (tree).
     * It can be a url or really anything unique.
     *
     * @var string
     */
    protected $id;

    /**
     * Tells if new comments can be added in this thread.
     *
     * @var bool
     *
     * @ORM\Column(name="is_commentable", type="boolean")
     */
    protected $isCommentable = true;

    /**
     * Denormalized number of comments.
     *
     * @var int
     *
     * @ORM\Column(name="num_comments", type="integer")
     */
    protected $numComments = 0;

    /**
     * Denormalized date of the last comment.
     *
     * @var DateTime
     *
     * @ORM\Column(name="last_comment_at", type="datetime", nullable=true)
     */
    protected $lastCommentAt = null;

    /**
     * Url of the page where the thread lives.
     *
     * @var string
     *
     * @ORM\Column(name="permalink", type="string", length=127)
     */
    protected $permalink;

    /**
     * @return string
     */
    public function __toString()
    {
        return 'Comment thread #'.$this->getId();
    }

    /**
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * @param  string
     */
    public function setId($id)
    {
        $this->id = $id;
    }

    /**
     * @return string
     */
    public function getPermalink()
    {
        return $this->permalink;
    }

    /**
     * @param  string
     *
     * @return void
     */
    public function setPermalink($permalink)
    {
        $this->permalink = $permalink;
    }

    /**
     * @return bool
     */
    public function isCommentable()
    {
        return $this->isCommentable;
    }

    /**
     * @param  bool
     *
     * @return void
     */
    public function setCommentable($isCommentable)
    {
        $this->isCommentable = (bool) $isCommentable;
    }

    /**
     * Gets the number of comments.
     *
     * @return int
     */
    public function getNumComments()
    {
        return $this->numComments;
    }

    /**
     * Sets the number of comments.
     *
     * @param int $numComments
     */
    public function setNumComments($numComments)
    {
        $this->numComments = intval($numComments);
    }

    /**
     * Increments the number of comments by the supplied
     * value.
     *
     * @param int $by Value to increment comments by
     *
     * @return int The new comment total
     */<commit_msg>Change AbstractThread commentable attribute to match expected naming in easy admin<commit_after><?php

/*
 * This file is part of the FOSCommentBundle package.
 *
 * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace App\Entity\Comment;

use DateTime;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\MappedSuperclass
 */
abstract class AbstractThread implements ThreadInterface
{
    /**
     * Id, a unique string that binds the comments together in a thread (tree).
     * It can be a url or really anything unique.
     *
     * @var string
     */
    protected $id;

    /**
     * Tells if new comments can be added in this thread.
     *
     * @var bool
     *
     * @ORM\Column(name="is_commentable", type="boolean")
     */
    protected $commentable = true;

    /**
     * Denormalized number of comments.
     *
     * @var int
     *
     * @ORM\Column(name="num_comments", type="integer")
     */
    protected $numComments = 0;

    /**
     * Denormalized date of the last comment.
     *
     * @var DateTime
     *
     * @ORM\Column(name="last_comment_at", type="datetime", nullable=true)
     */
    protected $lastCommentAt = null;

    /**
     * Url of the page where the thread lives.
     *
     * @var string
     *
     * @ORM\Column(name="permalink", type="string", length=127)
     */
    protected $permalink;

    /**
     * @return string
     */
    public function __toString()
    {
        return 'Comment thread #'.$this->getId();
    }

    /**
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * @param  string
     */
    public function setId($id)
    {
        $this->id = $id;
    }

    /**
     * @return string
     */
    public function getPermalink()
    {
        return $this->permalink;
    }

    /**
     * @param  string
     *
     * @return void
     */
    public function setPermalink($permalink)
    {
        $this->permalink = $permalink;
    }

    /**
     * @return bool
     */
    public function isCommentable()
    {
        return $this->commentable;
    }

    /**
     * @param  bool
     *
     * @return void
     */
    public function setCommentable($isCommentable)
    {
        $this->commentable = (bool) $isCommentable;
    }

    /**
     * Gets the number of comments.
     *
     * @return int
     */
    public function getNumComments()
    {
        return $this->numComments;
    }

    /**
     * Sets the number of comments.
     *
     * @param int $numComments
     */
    public function setNumComments($numComments)
    {
        $this->numComments = intval($numComments);
    }

    /**
     * Increments the number of comments by the supplied
     * value.
     *
     * @param int $by Value to increment comments by
     *
     * @return int The new comment total
     */
{'fraction_non_alphanumeric': 0.1199931822055565, 'fraction_numerical': 0.0013635588886995057, 'mean_word_length': 1.8750612444879962, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5379810', 'n_tokens_mistral': 1815, 'n_tokens_neox': 1765, 'n_words': 476}