Bake\Shell\Task\ModelTask::getTable PHP Method

getTable() public method

Uses the table option if it is set.
public getTable ( string $name ) : string
$name string Table name
return string
    public function getTable($name)
    {
        if (isset($this->params['table'])) {
            return $this->params['table'];
        }
        return Inflector::underscore($name);
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Test getName() method.
  *
  * @return void
  */
 public function testGetTable()
 {
     $result = $this->Task->getTable('BakeArticles');
     $this->assertEquals('bake_articles', $result);
     $this->Task->params['table'] = 'bake_articles';
     $result = $this->Task->getTable('Article');
     $this->assertEquals('bake_articles', $result);
 }
All Usage Examples Of Bake\Shell\Task\ModelTask::getTable