<commit_before><?php

/**
 * This file is part of the Propel package.
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @license    MIT License
 */

/**
 * Keeps tracks of an ActiveRecord object, even after deletion
 *
 * @author     <NAME>
 * @package    propel.generator.behavior.archivable
 */
class ArchivableBehaviorObjectBuilderModifier
{
	protected $behavior, $table, $builder;

	public function __construct($behavior)
	{
		$this->behavior = $behavior;
		$this->table = $behavior->getTable();
	}

	protected function getParameter($key)
	{
		return $this->behavior->getParameter($key);
	}

	/**
	 * @return string the PHP code to be added to the builder
	 */
	public function objectAttributes($builder)
	{
		$script = '';
		if ($this->behavior->isArchiveOnInsert()) {
			$script .= "protected \$archiveOnInsert = true;
";
		}
		if ($this->behavior->isArchiveOnUpdate()) {
			$script .= "protected \$archiveOnUpdate = true;<commit_msg>Add missing namespace declaration in archivable behavior.<commit_after><?php

/**
 * This file is part of the Propel package.
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @license    MIT License
 */

/**
 * Keeps tracks of an ActiveRecord object, even after deletion
 *
 * @author     <NAME>
 * @package    propel.generator.behavior.archivable
 */
class ArchivableBehaviorObjectBuilderModifier
{
	protected $behavior, $table, $builder;

	public function __construct($behavior)
	{
		$this->behavior = $behavior;
		$this->table = $behavior->getTable();
	}

	protected function getParameter($key)
	{
		return $this->behavior->getParameter($key);
	}

	/**
	 * @return string the PHP code to be added to the builder
	 */
	public function objectAttributes($builder)
	{
		if (!$this->behavior->hasArchiveClass()) {
			$builder->declareClassFromBuilder($builder->getNewStubQueryBuilder($this->behavior->getArchiveTable()));
		}
		$script = '';
		if ($this->behavior->isArchiveOnInsert()) {
			$script .= "protected \$archiveOnInsert = true;
";
		}
		if ($this->behavior->isArchiveOnUpdate()) {
			$script .= "protected \$archiveOnUpdate = true;
{'fraction_non_alphanumeric': 0.1321762349799733, 'fraction_numerical': 0.0, 'mean_word_length': 4.132420091324201, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 29, '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': '3753635', 'n_tokens_mistral': 702, 'n_tokens_neox': 632, 'n_words': 186}