This repository has been archived by the owner on Feb 5, 2024. It is now read-only.
/
Alter.php
64 lines (55 loc) · 1.52 KB
/
Alter.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
/*
* This file is part of the Doctrine\OrientDB package.
*
* (c) Alessandro Nadalin <alessandro.nadalin@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Command used to alter properties in a class.
*
* @package
* @subpackage
* @author Alessandro Nadalin <alessandro.nadalin@gmail.com>
*/
namespace Doctrine\OrientDB\Query\Command\Property;
use Doctrine\OrientDB\Query\Command\Property;
class Alter extends Property
{
/**
* Sets the $attribute to change and its new $value.
*
* @param string $attribute
* @param string $value
* @return Alter
*/
public function changing($attribute, $value)
{
$this->setToken('Attribute', $attribute);
$this->setToken('Value', $value);
return $this;
}
/**
* @inheritdoc
*/
protected function getSchema()
{
return "ALTER PROPERTY :Class.:Property :Attribute :Value";
}
/**
* Returns the formatters for this query's tokens.
*
* @return array
*/
protected function getTokenFormatters()
{
return array(
'Class' => "Doctrine\OrientDB\Query\Formatter\Query\Regular",
'Property' => "Doctrine\OrientDB\Query\Formatter\Query\Regular",
'Attribute' => "Doctrine\OrientDB\Query\Formatter\Query\Regular",
'Value' => "Doctrine\OrientDB\Query\Formatter\Query\Regular",
);
}
}