Development

/branches/1.3/lib/plugins/sfPropelPlugin/lib/builder/SfExtensionObjectBuilder.php

You must first sign up to be able to contribute.

root/branches/1.3/lib/plugins/sfPropelPlugin/lib/builder/SfExtensionObjectBuilder.php

Revision 23357, 1.6 kB (checked in by Kris.Wallsmith, 5 years ago)

[1.3] tagged custom propel builders as deprecated

  • Property svn:mime-type set to text/x-php
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
Line 
1 <?php
2
3 require_once 'propel/engine/builder/om/php5/PHP5ExtensionObjectBuilder.php';
4
5 /*
6  * This file is part of the symfony package.
7  * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
8  *
9  * For the full copyright and license information, please view the LICENSE
10  * file that was distributed with this source code.
11  */
12
13 /**
14  * @package    symfony
15  * @subpackage propel
16  * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
17  * @version    SVN: $Id$
18  *
19  * @deprecated since symfony 1.3
20  */
21 class SfExtensionObjectBuilder extends PHP5ExtensionObjectBuilder
22 {
23
24   public function build()
25   {
26     $code = parent::build();
27     if (!$this->getBuildProperty('builderAddComments'))
28     {
29       $code = sfToolkit::stripComments($code);
30     }
31
32     return $code;
33   }
34
35   /**
36    * Adds class phpdoc comment and openning of class.
37    *
38    * @param string &$script The script will be modified in this method
39    */
40   protected function addClassOpen(&$script)
41   {
42     parent::addClassOpen($script);
43
44     // remove comments and fix coding standards
45     $script = str_replace(array(" {\n", "\n\n\n"), array("\n{", "\n"), sfToolkit::stripComments($script));
46   }
47
48   /**
49       * Adds the applyDefaults() method, which is called from the constructor.
50       *
51       * @param string &$script The script will be modified in this method.
52       */
53   protected function addConstructor(&$script)
54   {
55   }
56
57   /**
58    * Closes class.
59    *
60    * @param string &$script The script will be modified in this method
61    */
62   protected function addClassClose(&$script)
63   {
64     parent::addClassClose($script);
65
66     // fix coding standards
67     $script = preg_replace('#} // .+$#m', '}', $script);
68   }
69 }
70
Note: See TracBrowser for help on using the browser.