RedBeanPHP\Facade::getColumns PHP Method

getColumns() public static method

Returns a list of columns. Format of this array: array( fieldname => type ) Note that this method only works in fluid mode because it might be quite heavy on production servers!
public static getColumns ( string $table ) : array
$table string name of the table (not type) you want to get columns of
return array
    public static function getColumns($table)
    {
        return self::$writer->getColumns($table);
    }

Usage Example

Example #1
0
 /**
  * Test special data types.
  *
  * @return void
  */
 public function testSpecialDataTypes()
 {
     testpack('Special data types');
     $bean = R::dispense('bean');
     $bean->date = 'someday';
     R::store($bean);
     $cols = R::getColumns('bean');
     asrt($cols['date'], 'TEXT');
     $bean = R::dispense('bean');
     $bean->date = '2011-10-10';
     R::nuke();
     $bean = R::dispense('bean');
     $bean->date = '2011-10-10';
     R::store($bean);
     $cols = R::getColumns('bean');
     asrt($cols['date'], 'NUMERIC');
 }
All Usage Examples Of RedBeanPHP\Facade::getColumns