. */ namespace Doctrine\DBAL\Platforms\Keywords; /** * Abstract interface for a SQL reserved keyword dictionary. * * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link www.doctrine-project.com * @since 2.0 * @author Benjamin Eberlei */ abstract class KeywordList { private $keywords = null; /** * Check if the given word is a keyword of this dialect/vendor platform. * * @param string $word * @return bool */ public function isKeyword($word) { if ($this->keywords === null) { $this->initializeKeywords(); } return isset($this->keywords[strtoupper($word)]); } protected function initializeKeywords() { $this->keywords = array_flip(array_map('strtoupper', $this->getKeywords())); } abstract protected function getKeywords(); /** * Name of this keyword list. * * @return string */ abstract public function getName(); }