'root', 'pass' => '', 'host' => 'localhost', 'database' => 'aphront_'.$this->getApplicationName(), )); } public function getTableName() { $class = strtolower(get_class($this)); if (!strncmp($class, 'aphront', 7)) { $class = substr($class, 7); } $app = $this->getApplicationName(); if (!strncmp($class, $app, strlen($app))) { $class = substr($class, strlen($app)); } return $app.'_'.$class; } abstract public function getApplicationName(); }