getTableInfo() public static method

Get table info anf return as an array.
public static getTableInfo ( ) : array
return array
Esempio n. 1
0
 /**
  * Constructor
  *
  * Instantiate the DB writer object.
  *
  * @param  \Pop\Db\Record $table
  * @throws Exception
  * @return \Pop\Log\Writer\Db
  */
 public function __construct(\Pop\Db\Record $table)
 {
     // Check that the table has the appropriate columns.
     $tableInfo = $table->getTableInfo();
     if (!array_key_exists('timestamp', $tableInfo['columns']) || !array_key_exists('priority', $tableInfo['columns']) || !array_key_exists('name', $tableInfo['columns']) || !array_key_exists('message', $tableInfo['columns'])) {
         throw new Exception("Error: The required table fields ('timestamp', 'priority', 'name' & 'message') do not exist in the table.");
     }
     $this->table = $table;
 }