<commit_before><?php

namespace App\Models;


use App\Core\Collection\AppCollection;

class Complaint extends Model
{
    protected $id;
    private $title;
    private $author;
    private $message;
    private $dateCreated;

    public function __construct(
        int $id = 0,
        string $title = '',
        string $author = '',
        string $message = '',
        string $dateCreated = ''
    )
    {
        $this->id = $id;
        $this->title = $title;
        $this->author = $author;
        $this->message = $message;
        $this->dateCreated = $dateCreated;
    }

    public static function empty() :self { return new self; }
    public function getTitle() :string { return $this->title; }
    public function getAuthor() :string { return $this->author; }
    public function getMessage() :string { return $this->message; }
    public function getDateCreated() :string { return $this->dateCreated; }

    public function setTitle(string $title = '') :void
    {
        $this->title = $title;
    }

    public function setAuthor(string $author = '') :void
    {
        $this->author = $author;
    }

    public function setMessage(string $message = '') :void
    {
        $this->message = $message;
    }

    public function saveAsData(): array
    {
        return [
            'title' => $this->title,
            'creator' => $this->author,
            'message' => $this->message,
            'date_added' => $this->dateCreated
        ];
    }

    public function convertToModel(AppCollection $data): IModel
    {
        return new self(
            $data->getInt('id'),
            $data->getString('title'),
            $data->getString('author'),
            $data->getString('message'),
            $data->getString('date_added')
        );
    }
}<commit_msg>[src/Models/Complaint.php] Add date modified to complaint model<commit_after><?php

namespace App\Models;


use App\Core\Collection\AppCollection;

class Complaint extends Model
{
    protected $id;
    private $title;
    private $author;
    private $message;
    private $dateCreated;
    private $dateModified;

    public function __construct(
        int $id = 0,
        string $title = '',
        string $author = '',
        string $message = '',
        string $dateCreated = '',
        string $dateModified = ''
    )
    {
        $this->id = $id;
        $this->title = $title;
        $this->author = $author;
        $this->message = $message;
        $this->dateCreated = $dateCreated;
        $this->dateModified = $dateModified;
    }

    public static function empty() :self { return new self; }
    public function getTitle() :string { return $this->title; }
    public function getAuthor() :string { return $this->author; }
    public function getMessage() :string { return $this->message; }
    public function getDateCreated() :string { return $this->dateCreated; }
    public function getDateModified() :string { return $this->dateModified; }

    public function setTitle(string $title = '') :void
    {
        $this->title = $title;
    }

    public function setAuthor(string $author = '') :void
    {
        $this->author = $author;
    }

    public function setMessage(string $message = '') :void
    {
        $this->message = $message;
    }

    public function setDateModified(string $dateModified = '') :void
    {
        $this->dateModified = $dateModified;
    }

    public function saveAsData(): array
    {
        return [
            'title' => $this->title,
            'creator' => $this->author,
            'message' => $this->message,
            'date_added' => $this->dateCreated,
            'date_updated' => $this->dateModified
        ];
    }

    public function convertToModel(AppCollection $data): IModel
    {
        return new self(
            $data->getInt('id'),
            $data->getString('title'),
            $data->getString('author'),
            $data->getString('message'),
            $data->getString('date_added'),
            $data->getString('date_updated')
        );
    }
}
{'fraction_non_alphanumeric': 0.13895048041389504, 'fraction_numerical': 0.0004927322000492732, 'mean_word_length': 2.2196669310071373, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 59, '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': '2232630', 'n_tokens_mistral': 1135, 'n_tokens_neox': 1112, 'n_words': 272}