public function getTableName($instance) { $class = new \ReflectionClass($instance); $nameParts = explode("\\", $class->getName()); return \ntentan\utils\Text::deCamelize(end($nameParts)); }
public function __set($name, $value) { $this->dataSet = true; $this->modelData[Text::deCamelize($name)] = $value; }
public function runDynamicMethod($arguments) { switch ($this->pendingMethod['method']) { case 'filterBy': $this->getQueryParameters()->addFilter(Text::deCamelize($this->pendingMethod['variable']), $arguments); return $this->wrapper; case 'sort': $this->getQueryParameters()->addSort(Text::deCamelize($this->pendingMethod['variable']), $this->pendingMethod['direction']); return $this->wrapper; case 'fetch': $parameters = $this->getQueryParameters(); $parameters->addFilter(Text::deCamelize($this->pendingMethod['variable']), $arguments); if ($this->pendingMethod['first'] === 'First') { $parameters->setFirstOnly(true); } return $this->doFetch(); } }
public function __toString() { $type = $this->renderWithType == '' ? \ntentan\utils\Text::deCamelize($this->getType()) : $this->renderWithType; return TemplateEngine::render("wyf_inputs_forms_{$type}.tpl.php", $this->getTemplateVariables()); }
public function testUnCamelCase() { $this->assertEquals('camel_case', Text::deCamelize("camelCase", '_')); $this->assertEquals('camel.case.joe', Text::deCamelize("CamelCaseJoe", '.')); }