1
<?php
2

3
/*
4
 * This file is part of the Solarium package.
5
 *
6
 * For the full copyright and license information, please view the COPYING
7
 * file that was distributed with this source code.
8
 */
9

10
namespace Solarium\QueryType\Server\CoreAdmin\Query\Action;
11

12
use Solarium\QueryType\Server\CoreAdmin\Query\Query as CoreAdminQuery;
13
use Solarium\QueryType\Server\Query\Action\AbstractAsyncAction;
14

15
/**
16
 * Class Rename.
17
 *
18
 * @see https://lucene.apache.org/solr/guide/coreadmin-api.html#coreadmin-rename
19
 */
20
class Rename extends AbstractAsyncAction implements CoreActionInterface
21
{
22
    use CoreActionTrait;
23

24
    /**
25
     * Returns the action type of the core admin action.
26
     *
27
     * @return string
28
     */
29 12
    public function getType(): string
30
    {
31 12
        return CoreAdminQuery::ACTION_RENAME;
32
    }
33

34
    /**
35
     * Set new name after renaming.
36
     *
37
     * @param string $other
38
     *
39
     * @return self Provides fluent interface
40
     */
41 12
    public function setOther($other): self
42
    {
43 12
        $this->setOption('other', $other);
44

45 12
        return $this;
46
    }
47

48
    /**
49
     * Get the other core that should be the new name.
50
     *
51
     * @return string|null
52
     */
53 12
    public function getOther(): ?string
54
    {
55 12
        return $this->getOption('other');
56
    }
57
}

Read our documentation on viewing source code .

Loading