protected function validate($value) { $valueArray = explode(".", $value); if (count($valueArray) > 1) { array_pop($valueArray); } parent::validate(implode(".", $valueArray)); if (!preg_match("/^([a-zA-Z0-9:_-]+\\.)?([a-zA-Z0-9:_-]+\\.)?[a-zA-Z0-9:_-]+\$/is", $value)) { throw new ErrorException("Invalid column-specifier given: '{$value}'!"); } }
public function convertSqlToJob(SQLTokenIterator $tokens) { $parts = array(); do { $tokens->seekIndex($tokens->getExclusiveTokenIndex()); $part = $tokens->getCurrentTokenString(); if ($part[0] === '`' && $part[strlen($part) - 1] === '`') { $part = substr($part, 1, strlen($part) - 2); } $parts[] = $part; } while ($tokens->seekTokenText(".") && !$tokens->isTokenText('*')); return TableSpecifier::factory(implode(".", $parts)); }