<commit_before><?php 

class PageController extends \Core\Controller
{
	protected $page;
	protected $posts;

	public function __construct()
	{
		parent::__construct();
		$this->page = \Core\Model::load('page');
		$this->post = \Core\Model::load('post');
        $this->user = \Core\Model::load('user');
	}

	public function index()
	{
		$user = $this->auth->user();
		$content = $this->page->first()->content;
        $posts = $this->user->first()->post;

        $last_post = $posts->orderBy('name', 'asc')->last('name');

		if($this->isAjax())
		{
			$this->view->json(compact('content'));
		}
		else
		{
			$this->view->render('index', compact('content', 'user', 'posts', 'last_post'));
		}
	}
}<commit_msg>test active record<commit_after><?php 

use \Core\Model;

class PageController extends \Core\Controller
{
	protected $page;
	protected $posts;

	public function __construct()
	{
		parent::__construct();
		$this->page = Model::load('page');
		$this->post = Model::load('post');
        $this->user = Model::load('user');
	}

	public function index()
	{
		$user = $this->auth->user();
		$content = $this->page->first()->content;
        $posts = $this->user->first()->post;

        $last_post = $posts->orderBy('name', 'asc')->last('name');

        $new_post = new $this->post;
        $new_post->name = 'test';
        $new_post->content = 'blablabla';
        $new_post->user_id = $user->id;
        $new_post->save();

		if($this->isAjax())
		{
			$this->view->json(compact('content'));
		}
		else
		{
			$this->view->render('index', compact('content', 'user', 'posts', 'last_post'));
		}
	}
}
{'fraction_non_alphanumeric': 0.22478206724782068, 'fraction_numerical': 0.0, 'mean_word_length': 3.5014005602240896, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 45, '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': '4986432', 'n_tokens_mistral': 592, 'n_tokens_neox': 548, 'n_words': 92}