<commit_before><?php

use Phalcon\Tag,
	Phalcon\Mvc\Model\Criteria,
	Phalcon\Paginator\Adapter\Model as Paginator;

class $className$Controller extends ControllerBase
{

	/**
	 * Index action
	 */
	public function indexAction()
	{
		$this->persistent->parameters = null;
	}

	/**
	 * Searches for $plural$
	 */
	public function searchAction()
	{

		$numberPage = 1;
		if ($this->request->isPost()) {
			$query = Criteria::fromInput($this->di, "$className$", $_POST);
			$this->persistent->parameters = $query->getParams();
		} else {
			$numberPage = $this->request->getQuery("page", "int");
			if ($numberPage <= 0) {
				$numberPage = 1;
			}
		}

		$parameters = $this->persistent->parameters;
		if (!is_array($parameters)) {
			$parameters = array();
		}
		$parameters["order"] = "$pk$";

		$pluralVar$ = $className$::find($parameters);
		if (count($pluralVar$) == 0) {
			$this->flash->notice("The search did not find any $plural$");
			return $this->dispatcher->forward(array(
				"controller" => "$plural$",
				"action" => "index"
			));
		}

		$paginator = new Paginator(array(
			"data" => $pluralVar$,
			"limit"=> 10,
			"page" => $numberPage
		));

		$this->view->page = $paginator->getPaginate();
	}

	/**
	 * Displayes the creation form
	 */
	public function newAction()
	{

	}

	/**
	 * Edits a $singular$
	 *
	 * @param string $pkVar$
	 */
	public function editAction($pkVar$)
	{

		if (!$this->request->isPost()) {

			$singularVar$ = $className$::findFirstById($id);
			if (!$singularVar$) {
				$this->flash->error("$singular$ was not found");
				return $this->dispatcher->forward(array(
					"controller" => "$plural$",
					"action" => "index"
				));
			}

			$this->view->$pk$ = $singularVar$->$pk$;

			$assignTagDefaults$
		}
	}<commit_msg>Change key field variable name from $id to $pkVar$ in editAction<commit_after><?php

use Phalcon\Tag,
	Phalcon\Mvc\Model\Criteria,
	Phalcon\Paginator\Adapter\Model as Paginator;

class $className$Controller extends ControllerBase
{

	/**
	 * Index action
	 */
	public function indexAction()
	{
		$this->persistent->parameters = null;
	}

	/**
	 * Searches for $plural$
	 */
	public function searchAction()
	{

		$numberPage = 1;
		if ($this->request->isPost()) {
			$query = Criteria::fromInput($this->di, "$className$", $_POST);
			$this->persistent->parameters = $query->getParams();
		} else {
			$numberPage = $this->request->getQuery("page", "int");
			if ($numberPage <= 0) {
				$numberPage = 1;
			}
		}

		$parameters = $this->persistent->parameters;
		if (!is_array($parameters)) {
			$parameters = array();
		}
		$parameters["order"] = "$pk$";

		$pluralVar$ = $className$::find($parameters);
		if (count($pluralVar$) == 0) {
			$this->flash->notice("The search did not find any $plural$");
			return $this->dispatcher->forward(array(
				"controller" => "$plural$",
				"action" => "index"
			));
		}

		$paginator = new Paginator(array(
			"data" => $pluralVar$,
			"limit"=> 10,
			"page" => $numberPage
		));

		$this->view->page = $paginator->getPaginate();
	}

	/**
	 * Displayes the creation form
	 */
	public function newAction()
	{

	}

	/**
	 * Edits a $singular$
	 *
	 * @param string $pkVar$
	 */
	public function editAction($pkVar$)
	{

		if (!$this->request->isPost()) {

			$singularVar$ = $className$::findFirstById($pkVar$);
			if (!$singularVar$) {
				$this->flash->error("$singular$ was not found");
				return $this->dispatcher->forward(array(
					"controller" => "$plural$",
					"action" => "index"
				));
			}

			$this->view->$pk$ = $singularVar$->$pk$;

			$assignTagDefaults$
		}
	}
{'fraction_non_alphanumeric': 0.19949846753970465, 'fraction_numerical': 0.0033435497353023124, 'mean_word_length': 3.5157232704402515, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 73, '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': '3389307', 'n_tokens_mistral': 1460, 'n_tokens_neox': 1238, 'n_words': 240}