2023-09-05 05:06:53 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\ORM\Tests\DataQueryTest;
|
|
|
|
|
|
|
|
use SilverStripe\Dev\TestOnly;
|
|
|
|
use SilverStripe\ORM\FieldType\DBText;
|
2023-09-14 01:01:36 +02:00
|
|
|
use SilverStripe\ORM\Queries\SQLSelect;
|
2023-09-05 05:06:53 +02:00
|
|
|
|
|
|
|
class DBFieldAddsToQuery extends DBText implements TestOnly
|
|
|
|
{
|
|
|
|
public function addToQuery(&$query)
|
|
|
|
{
|
2023-09-14 01:01:36 +02:00
|
|
|
// Add a new item, to validate that tableName and name are set correctly.
|
|
|
|
/** @var SQLSelect $query */
|
|
|
|
$query->addSelect([$this->name . '2' => '"' . $this->tableName . '"."' . $this->name . '"']);
|
2023-09-05 05:06:53 +02:00
|
|
|
}
|
|
|
|
}
|