protected function addDoInsert(&$script) { $tmp = ''; parent::addDoInsert($tmp); if (DataModelBuilder::getBuildProperty('builderAddBehaviors')) { // add sfMixer call $pre_mixer_script = "\n\n foreach (sfMixer::getCallables('{$this->getClassname()}:doInsert:pre') as \$callable)\n {\n \$ret = call_user_func(\$callable, '{$this->getClassname()}', \$values, \$con);\n if (false !== \$ret)\n {\n return \$ret;\n }\n }\n\n"; $post_mixer_script = "\n foreach (sfMixer::getCallables('{$this->getClassname()}:doInsert:post') as \$callable)\n {\n call_user_func(\$callable, '{$this->getClassname()}', \$values, \$con, \$pk);\n }\n\n return"; $tmp = preg_replace('/{/', '{' . $pre_mixer_script, $tmp, 1); $tmp = preg_replace("/\t\treturn/", "\t\t" . $post_mixer_script, $tmp, 1); } $script .= $tmp; }