Example #1
0
 protected function addDelete(&$script)
 {
     $tmp = '';
     parent::addDelete($tmp);
     if (DataModelBuilder::getBuildProperty('builderAddBehaviors')) {
         // add sfMixer call
         $pre_mixer_script = "\n\n    foreach (sfMixer::getCallables('{$this->getClassname()}:delete:pre') as \$callable)\n    {\n      \$ret = call_user_func(\$callable, \$this, \$con);\n      if (\$ret)\n      {\n        return;\n      }\n    }\n\n";
         $post_mixer_script = "\n\n    foreach (sfMixer::getCallables('{$this->getClassname()}:delete:post') as \$callable)\n    {\n      call_user_func(\$callable, \$this, \$con);\n    }\n\n";
         $tmp = preg_replace('/{/', '{' . $pre_mixer_script, $tmp, 1);
         $tmp = preg_replace('/}\\s*$/', $post_mixer_script . '  }', $tmp);
     }
     // update current script
     $script .= $tmp;
 }