<commit_before><?php
namespace Modules\Admin\Controllers;

use \Entity\VideoChannel;
use \Entity\VideoChannel as Record;

class VideosController extends BaseController
{
    public function permissions()
    {
        return $this->acl->isAllowed('administer stations');
    }
    
    public function indexAction()
    {
        $records = $this->em->createQuery('SELECT v FROM Entity\Video v ORDER BY v.weight ASC, v.id ASC')
            ->getArrayResult();

        $this->view->stations = $records;
    }
    
    public function editAction()
    {
        $form = new \DF\Form($this->current_module_config->forms->video);
        
        if ($this->hasParam('id'))
        {
            $id = (int)$this->getParam('id');
            $record = Record::find($id);
            $form->setDefaults($record->toArray(FALSE, TRUE));
        }

        if($_POST && $form->isValid($_POST) )
        {
            $data = $form->getValues();

            if (!($record instanceof Record))
                $record = new Record;

            $files = $form->processFiles('videos');

            foreach($files as $file_field => $file_paths)<commit_msg>Fix record name in second spot.<commit_after><?php
namespace Modules\Admin\Controllers;

use \Entity\VideoChannel;
use \Entity\VideoChannel as Record;

class VideosController extends BaseController
{
    public function permissions()
    {
        return $this->acl->isAllowed('administer stations');
    }
    
    public function indexAction()
    {
        $records = $this->em->createQuery('SELECT v FROM Entity\VideoChannel v ORDER BY v.weight ASC, v.id ASC')
            ->getArrayResult();

        $this->view->stations = $records;
    }
    
    public function editAction()
    {
        $form = new \DF\Form($this->current_module_config->forms->video);
        
        if ($this->hasParam('id'))
        {
            $id = (int)$this->getParam('id');
            $record = Record::find($id);
            $form->setDefaults($record->toArray(FALSE, TRUE));
        }

        if($_POST && $form->isValid($_POST) )
        {
            $data = $form->getValues();

            if (!($record instanceof Record))
                $record = new Record;

            $files = $form->processFiles('videos');

            foreach($files as $file_field => $file_paths)
{'fraction_non_alphanumeric': 0.1445835131635736, 'fraction_numerical': 0.0, 'mean_word_length': 2.2149791955617197, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 39, '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': '6980795', 'n_tokens_mistral': 661, 'n_tokens_neox': 641, 'n_words': 140}