Пример #1
0
    protected function addClassClose(&$script)
    {
        parent::addClassClose($script);
        $behaviors = $this->getTable()->getAttribute('behaviors');
        if ($behaviors) {
            $behavior_file_name = 'Base' . $this->getTable()->getPhpName() . 'Behaviors';
            $behavior_file_path = ClassTools::getFilePath($this->getStubObjectBuilder()->getPackage() . '.om', $behavior_file_name);
            $behavior_include_script = <<<EOF


if (sfProjectConfiguration::getActive() instanceof sfApplicationConfiguration)
{
  include_once '%s';
}

EOF;
            $script .= sprintf($behavior_include_script, $behavior_file_path);
        }
    }
 protected function addClassClose(&$script)
 {
     parent::addClassClose($script);
     $behaviors = $this->getTable()->getAttribute('behaviors');
     if ($behaviors) {
         $behavior_file_name = 'Base' . $this->getTable()->getPhpName() . 'Behaviors';
         $behavior_file_path = ClassTools::getFilePath($this->getStubObjectBuilder()->getPackage() . '.om', $behavior_file_name);
         $script .= sprintf("\ninclude_once '%s';\n", $behavior_file_path);
     }
 }