Development

/branches/1.3/lib/plugins/sfPropelPlugin/lib/behavior/SfPropelBehaviorBase.php

You must first sign up to be able to contribute.

root/branches/1.3/lib/plugins/sfPropelPlugin/lib/behavior/SfPropelBehaviorBase.php

Revision 23310, 1.2 kB (checked in by Kris.Wallsmith, 5 years ago)

[1.3] added copyright notices to propel behaviors, remove some unneeded generated methods

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
Line 
1 <?php
2
3 /*
4  * This file is part of the symfony package.
5  * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
6  *
7  * For the full copyright and license information, please view the LICENSE
8  * file that was distributed with this source code.
9  */
10
11 require_once 'propel/engine/database/model/Behavior.php';
12
13 /**
14  * Base behavior class.
15  *
16  * @package     sfPropelPlugin
17  * @subpackage  behavior
18  * @author      Kris Wallsmith <kris.wallsmith@symfony-project.com>
19  * @version     SVN: $Id$
20  */
21 abstract class SfPropelBehaviorBase extends Behavior
22 {
23   protected
24     $buildProperties = null;
25
26   /**
27    * Returns a build property from propel.ini.
28    *
29    * @param string $name
30    *
31    * @return mixed
32    */
33   protected function getBuildProperty($name)
34   {
35     if (null === $this->buildProperties)
36     {
37       $this->buildProperties = new Properties();
38       $this->buildProperties->load(new PhingFile(sfConfig::get('sf_config_dir').'/propel.ini'));
39     }
40
41     return $this->buildProperties->getProperty($name);
42   }
43
44   /**
45    * Returns true if the current behavior has been disabled.
46    *
47    * @return boolean
48    */
49   protected function isDisabled()
50   {
51     return 'true' == $this->getParameter('disabled');
52   }
53 }
54
Note: See TracBrowser for help on using the browser.