/** * @param $name * @return mixed * @throws \OutOfBoundsException */ public function __get($name) { $fn = 'get' . Inflector::classify($name); if (method_exists($this, $fn)) { return $this->{$fn}(); } else { throw new \OutOfBoundsException("getter '{$fn}' does not exist"); } }
/** * @param $op * @return string */ public function getLookUpMethod($op) { return Inflector::camelize('lookup_' . $op); }
/** * @param $tname * @return string */ protected function table2model($tname) { return $this->prefix . Inflector::classify($tname); }
public function testCamelize() { $this->assertEquals('myTableName', \Dja\Util\Inflector::camelize('my_table_name')); }
/** * return manual setted or generate table name * User -> users, UserRole -> user_roles * @return null|string */ public function getDbTableName() { if ($this->dbTableName === null) { $this->dbTableName = Inflector::namespacedTableize($this->modelClassName); } return $this->dbTableName; }