示例#1
0
 /**
  * Returns the best class name for a given behavior.
  *
  * If not found, the method tries to autoload \Propel\Generator\Behavior\[Bname]\[Bname]Behavior
  *
  * @param  string                    $behavior The behavior name (ie: timestampable)
  * @return string                    $class The behavior fully qualified class name
  * @throws BehaviorNotFoundException
  */
 public function getConfiguredBehavior($behavior)
 {
     if (false !== strpos($behavior, '\\')) {
         $class = $behavior;
     } else {
         $generator = new PhpNameGenerator();
         $phpName = $generator->generateName(array($behavior, PhpNameGenerator::CONV_METHOD_PHPNAME));
         $class = sprintf('\\Propel\\Generator\\Behavior\\%s\\%sBehavior', $phpName, $phpName);
     }
     if (!class_exists($class)) {
         throw new BehaviorNotFoundException(sprintf('Unknown behavior "%s"', $behavior));
     }
     return $class;
 }
示例#2
0
 public function underscoreMethod($schemaName)
 {
     return parent::underscoreMethod($schemaName);
 }
示例#3
0
 /**
  * Searches for the given behavior name in the Propel\Generator\Behavior namespace as
  * \Propel\Generator\Behavior\[Bname]\[Bname]Behavior
  *
  * @param  string $name The behavior name (ie: timestampable)
  * @return string The behavior fully qualified class name
  */
 private function getCoreBehavior($name)
 {
     $generator = new PhpNameGenerator();
     $phpName = $generator->generateName([$name, PhpNameGenerator::CONV_METHOD_PHPNAME]);
     return sprintf('\\Propel\\Generator\\Behavior\\%s\\%sBehavior', $phpName, $phpName);
 }