ppshobi /
psonic
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Psonic\Commands\Ingest; |
||
| 4 | |||
| 5 | use Psonic\Commands\Command; |
||
| 6 | |||
| 7 | final class PushCommand extends Command |
||
| 8 | { |
||
| 9 | private $command = 'PUSH'; |
||
| 10 | private $parameters = []; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * Push a text/object into an object/bucket respectively |
||
| 14 | * PushCommand constructor. |
||
| 15 | * @param string $collection |
||
| 16 | * @param string $bucket |
||
| 17 | * @param string $object |
||
| 18 | * @param string $text |
||
| 19 | * @param string $locale - a Valid ISO 639-3 locale (eng = English), if set to `none` lexing will be disabled |
||
| 20 | */ |
||
| 21 | public function __construct(string $collection, string $bucket, string $object, string $text, string $locale=null) |
||
| 22 | { |
||
| 23 | $this->parameters = [ |
||
| 24 | 'collection' => $collection, |
||
| 25 | 'bucket' => $bucket, |
||
| 26 | 'object' => $object, |
||
| 27 | 'text' => self::wrapInQuotes($text), |
||
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||
| 28 | 'locale' => $locale ? "LANG($locale)": null, |
||
| 29 | ]; |
||
| 30 | |||
| 31 | parent::__construct($this->command, $this->parameters); |
||
| 32 | } |
||
| 33 | } |