/** * Validates the current table to make sure that it won't * result in generated code that will not parse. * * This method may emit warnings for code which may cause problems * and will throw exceptions for errors that will definitely cause * problems. */ protected function validateModel() { parent::validateModel(); $table = $this->getTable(); // Check to see if any of the column constants are PHP reserved words. $colConstants = array(); foreach ($table->getColumns() as $col) { $colConstants[] = $this->getColumnName($col); } $reservedConstants = array_map('strtoupper', ClassTools::getPhpReservedWords()); $intersect = array_intersect($reservedConstants, $colConstants); if (!empty($intersect)) { throw new EngineException("One or more of your column names for [" . $table->getName() . "] table conflict with a PHP reserved word (" . implode(", ", $intersect) . ")"); } }