/** * Find the best class name for a given behavior * Looks in build.properties for path like propel.behavior.[bname].class * If not found, tries to autoload [Bname]Behavior * If no success, returns 'Behavior' * * @param string $bname behavior name, e.g. 'timestampable' * @return string behavior class name, e.g. 'TimestampableBehavior' * @throws InvalidArgumentException */ public function getConfiguredBehavior($bname) { if ($config = $this->getGeneratorConfig()) { if ($class = $config->getConfiguredBehavior($bname)) { return $class; } } // fallback: maybe the behavior is loaded or autoloaded $gen = new PhpNameGenerator(); if (class_exists($class = $gen->generateName(array($bname, PhpNameGenerator::CONV_METHOD_PHPNAME)) . 'Behavior')) { return $class; } throw new InvalidArgumentException(sprintf('Unknown behavior "%s"; make sure you configured the propel.behavior.%s.class setting in your build.properties', $bname, $bname)); }
/** * Find the best class name for a given behavior * Looks in build.properties for path like propel.behavior.[bname].class * If not found, tries to autoload [Bname]Behavior * If no success, returns 'Behavior' * * @param string $bname behavior name, e.g. 'timestampable' * @return string behavior class name, e.g. 'TimestampableBehavior' */ public function getConfiguredBehavior($bname) { if ($config = $this->getGeneratorConfig()) { if ($class = $config->getConfiguredBehavior($bname)) { return $class; } } // first fallback: maybe the behavior is loaded or autoloaded $gen = new PhpNameGenerator(); if (class_exists($class = $gen->generateName(array($bname, PhpNameGenerator::CONV_METHOD_PHPNAME)) . 'Behavior')) { return $class; } // second fallback: use parent behavior class (mostly for unit tests) return 'Behavior'; }
public function phpnameMethod($schemaName) { return parent::phpnameMethod($schemaName); }
public function underscoreMethod($schemaName) { return parent::underscoreMethod($schemaName); }
private function getCamelizedColumnName() { $p = new PhpNameGenerator(); return 'filterBy' . $p->generateName(array($this->behavior->getParameter('column_name'), PhpNameGenerator::CONV_METHOD_PHPNAME)); }