protected function addDoUpdate(&$script) { parent::addDoUpdate($script); $script .= "\t\n\t/**\n\t * Return array of columns that should change only if there is a real change.\n\t * @return array\n\t */\n\tpublic static function getAtomicColumns()\n\t{\n\t\treturn array();\n\t}\n\t\n\t/**\n\t * Return array of custom-data fields that shouldn't be auto-updated.\n\t * @return array\n\t */\n\tpublic static function getAtomicCustomDataFields()\n\t{\n\t\treturn array();\n\t}\n"; }
protected function addDoUpdate(&$script) { $tmp = ''; parent::addDoUpdate($tmp); if (DataModelBuilder::getBuildProperty('builderAddBehaviors')) { // add sfMixer call $pre_mixer_script = "\n\n foreach (sfMixer::getCallables('{$this->getClassname()}:doUpdate: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\n foreach (sfMixer::getCallables('{$this->getClassname()}:doUpdate:post') as \$callable)\n {\n call_user_func(\$callable, '{$this->getClassname()}', \$values, \$con, \$ret);\n }\n\n return \$ret;\n"; $tmp = preg_replace('/{/', '{' . $pre_mixer_script, $tmp, 1); $tmp = preg_replace("/\t\treturn ([^}]+)/", "\t\t\$ret = \$1" . $post_mixer_script . ' ', $tmp, 1); } $script .= $tmp; }