/** !Route GET, model/gen/getTableProps/$sourceName/$tableName */
 public function getTableProps($sourceName, $tableName)
 {
     $source = Databases::getSource($sourceName);
     if ($source == null) {
         return $this->redirect($this->urlTo('home'));
     } else {
         $this->source = $source;
     }
     $this->sourceName = $sourceName;
     $this->table = $tableName;
     $this->columns = $this->source->getTableDescriptor($tableName)->getColumns();
 }
Exemplo n.º 2
0
 function getSource()
 {
     if (!$this->source) {
         return Databases::getDefaultSource();
     } else {
         return Databases::getSource($this->source);
     }
 }
 /** !Route POST, source/$sourceName/table/$tableName/empty */
 public function emptyTablePost($sourceName, $tableName)
 {
     $source = Databases::getSource($sourceName);
     $source->emptyTable($tableName);
     return $this->forwardOk($this->urlTo('showTable', $sourceName, $tableName));
 }