<commit_before>---
title: "<?php echo $alias; ?> action",
finders: ["<?php echo $alias; ?>"]
---

    function <?php echo $alias; ?>($<?php echo $admin->primaryKey; ?> = null) {
        $<?php echo $admin->primaryKey; ?> = (!$<?php echo $admin->primaryKey; ?> && !empty($this->params['named']['<?php echo $admin->primaryKey; ?>'])) ? $this->params['named']['<?php echo $admin->primaryKey; ?>'] : $<?php echo $admin->primaryKey; ?>;
        $<?php echo $singularName; ?> = $this-><?php echo $currentModelName; ?>->find('view', array('<?php echo $admin->primaryKey; ?>' => $<?php echo $admin->primaryKey; ?>));

        if (!$<?php echo $singularName; ?>) {
<?php if ($admin->sessions): ?>
            $this->Session->setFlash(__('Invalid <?php echo ucfirst(strtolower($singularHumanName)); ?>', true), 'flash/error');<commit_msg>genericized view find method<commit_after>---
title: "<?php echo $alias; ?> action",
finders: ["<?php echo $alias; ?>"]
---

    function <?php echo $alias; ?>($<?php echo $admin->primaryKey; ?> = null) {
        $<?php echo $admin->primaryKey; ?> = (!$<?php echo $admin->primaryKey; ?> && !empty($this->params['named']['<?php echo $admin->primaryKey; ?>'])) ? $this->params['named']['<?php echo $admin->primaryKey; ?>'] : $<?php echo $admin->primaryKey; ?>;
        $<?php echo $singularName; ?> = $this-><?php echo $currentModelName; ?>->find('<?php echo $alias; ?>', array('<?php echo $admin->primaryKey; ?>' => $<?php echo $admin->primaryKey; ?>));

        if (!$<?php echo $singularName; ?>) {
<?php if ($admin->sessions): ?>
            $this->Session->setFlash(__('Invalid <?php echo ucfirst(strtolower($singularHumanName)); ?>', true), 'flash/error');
{'fraction_non_alphanumeric': 0.2665876777251185, 'fraction_numerical': 0.0, 'mean_word_length': 4.648829431438127, 'pattern_counts': {'":': 0, '<': 36, '<?xml version=': 0, '>': 68, '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': '6864429', 'n_tokens_mistral': 537, 'n_tokens_neox': 524, 'n_words': 122}