Beispiel #1
0
 /**
  * Returns classname in underscored form, with "_id" tacked on at the end.
  * This is for use in dealing with foreign keys in the database.
  *
  * @param string $class_name                Class name.
  * @param bool   $separate_with_underscore  Separate with underscore.
  *
  * @return strong Foreign key
  */
 public static function foreign_key($class_name, $separate_with_underscore = true)
 {
     return sfInflector::underscore(sfInflector::demodulize($class_name)) . ($separate_with_underscore ? "_id" : "id");
 }