<commit_before><?php
namespace App\Controller;

use App\Controller\AppController;
use Cake\Network\Exception\NotFoundException;
use Cake\Utility\Text;

/**
 * Clients Controller
 *
 * @property \App\Model\Table\ClientsTable $Clients
 */
class ClientsController extends AppController
{

    /**
     * Index method
     *
     * @return void
     */
    public function index()
    {
        $this->set('clients', $this->paginate($this->Clients));
        $this->set('_serialize', ['clients']);
    }

    /**
     * @param $uuid
     * @throws NotFoundException
     */
    public function view($uuid)
    {
        if(empty($uuid))
        {
            throw new NotFoundException;
        }

        if(!is_numeric($uuid)){
            $clientID = $this->Clients->getIDbyUUID($uuid);
        }
        else{
            $clientID = $uuid;
        }

        $client = $this->Clients->get($clientID, [
            'contain' => []
        ]);
        $this->set('client', $client);
        $this->set('_serialize', ['client']);
    }

    /**
     * Add method<commit_msg>Client CRUD done<commit_after><?php
namespace App\Controller;

use App\Controller\AppController;
use Cake\Network\Exception\NotFoundException;
use Cake\Utility\Text;

/**
 * Clients Controller
 *
 * @property \App\Model\Table\ClientsTable $Clients
 */
class ClientsController extends AppController
{

    /**
     * Index method
     *
     * @return void
     */
    public function index()
    {
        $this->paginate = [
            'conditions' => ['Clients.status' => 1],
            'fields' => ['Clients.id', 'Clients.uuid',  'Clients.email', 'Clients.status', 'Clients.name', 'Clients.phone', 'Clients.city', 'Clients.website'],
            'recursive' => -1,
            'limit' => $this->paginationLimit,
            'order' => ['Clients.id' => 'desc']
        ];

        $this->set('clients', $this->paginate($this->Clients));
        $this->set('_serialize', ['clients']);
    }

    /**
     * @param $uuid
     * @throws NotFoundException
     */
    public function view($uuid)
    {
        if(empty($uuid))
        {
            throw new NotFoundException;
        }

        if(!is_numeric($uuid)){
            $clientID = $this->Clients->getIDbyUUID($uuid);
        }
        else{
            $clientID = $uuid;
        }

        $client = $this->Clients->get($clientID, [
            'contain' => []
        ]);
        $this->set('client', $client);
        $this->set('_serialize', ['client']);
    }

    /**
     * Add method
{'fraction_non_alphanumeric': 0.16772151898734178, 'fraction_numerical': 0.0007911392405063291, 'mean_word_length': 2.0396634615384617, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 34, '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': '4652496', 'n_tokens_mistral': 775, 'n_tokens_neox': 762, 'n_words': 131}