. */ namespace Doctrine\ORM\Mapping; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\DBAL\Platforms\AbstractPlatform; /** * A set of rules for determining the physical column, alias and table quotes * * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link www.doctrine-project.org * @since 2.4 * @author Fabio B. Silva */ abstract class QuoteStrategy { /** * @var \Doctrine\DBAL\Platforms\AbstractPlatform */ protected $platform; /** * @param AbstractPlatform $platform */ public function __construct(AbstractPlatform $platform) { $this->platform = $platform; } /** * Checks if the given identifier is quoted * * @param string $identifier * @return string */ abstract public function isQuotedIdentifier($identifier); /** * Gets the uquoted column name. * * @param string $identifier * @return string */ abstract public function getUnquotedIdentifier($identifier); /** * Gets the (possibly quoted) column name for safe use in an SQL statement. * * @param string $fieldName * @param ClassMetadata $class * @return string */ abstract public function getColumnName($fieldName, ClassMetadata $class); /** * Gets the (possibly quoted) primary table name for safe use in an SQL statement. * * @param ClassMetadata $class * @return string */ abstract public function getTableName(ClassMetadata $class); /** * Gets the (possibly quoted) name of the join table. * * @param ClassMetadata $class * @return string */ abstract public function getJoinTableName($relation, ClassMetadata $class); /** * Gets the (possibly quoted) identifier column names for safe use in an SQL statement. * * @param ClassMetadata $class * @return array */ abstract public function getIdentifierColumnNames(ClassMetadata $class); /** * Gets the column alias. * * @param string $columnName * @param integer $counter * @param ClassMetadata $class * @return string */ abstract public function getColumnAlias($columnName, $counter, ClassMetadata $class = null); }