<commit_before><?php

/**
 * organisme actions.
 *
 * @package    cpc
 * @subpackage photos
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 12474 2008-10-31 10:41:27Z fabien $
 */
class photosActions extends sfActions
{

  public function executeFlip(sfWebRequest $request) {
    $ids = "";
    $total = Doctrine_Query::create()->select('max(id)')->from('Parlementaire')->fetchOne();
    for ($i=1; $i <= $total['max']; $i++) if ($flip = $request->getParameter('flip'.$i)) {
      if ($ids != "") $ids .= ",";
      $ids .= ','.$i;
    }
    if ($ids) $query = Doctrine_Query::create()
      ->update('Parlementaire')
      ->set('autoflip', 1)
      ->whereIn('id', explode(',', $ids))
      ->execute();
    $this->parlementaires = Doctrine::getTable('Parlementaire')
      ->createQuery()
      ->orderBy('nom_de_famille')
      ->execute();
  }

}<commit_msg>fix backend flip photo tool<commit_after><?php

/**
 * organisme actions.
 *
 * @package    cpc
 * @subpackage photos
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 12474 2008-10-31 10:41:27Z fabien $
 */
class photosActions extends sfActions
{

  public function executeFlip(sfWebRequest $request) {
    $ids = "";
    $total = Doctrine_Query::create()->select('max(id)')->from('Parlementaire')->fetchOne();
    for ($i=1; $i <= $total['max']; $i++) if ($flip = $request->getParameter('flip'.$i)) {
      if ($ids != "") $ids .= ",";
      $ids .= ','.$i;
    }
    if ($ids) {
      $query = Doctrine_Query::create()->select('id, autoflip')->from('Parlementaire')->whereIn('id', explode(',', $ids));
      foreach ($query->fetchArray() as $dep)
        $query = Doctrine_Query::create()
          ->update('Parlementaire')
          ->set('autoflip', 1-$dep['autoflip'])
          ->where('id = ?', $dep['id'])
          ->execute();
    }
    $this->parlementaires = Doctrine::getTable('Parlementaire')
      ->createQuery()
      ->orderBy('nom_de_famille')
      ->execute();
  }

}
{'fraction_non_alphanumeric': 0.21389305347326337, 'fraction_numerical': 0.020989505247376312, 'mean_word_length': 3.1449275362318843, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 31, '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': '4436482', 'n_tokens_mistral': 703, 'n_tokens_neox': 665, 'n_words': 130}