Exemple #1
0
 public function getTableName($instance)
 {
     $class = new \ReflectionClass($instance);
     $nameParts = explode("\\", $class->getName());
     return \ntentan\utils\Text::deCamelize(end($nameParts));
 }
Exemple #2
0
 public function __set($name, $value)
 {
     $this->dataSet = true;
     $this->modelData[Text::deCamelize($name)] = $value;
 }
Exemple #3
0
 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();
     }
 }
Exemple #4
0
 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());
 }
Exemple #5
0
 public function testUnCamelCase()
 {
     $this->assertEquals('camel_case', Text::deCamelize("camelCase", '_'));
     $this->assertEquals('camel.case.joe', Text::deCamelize("CamelCaseJoe", '.'));
 }