|
|
@ -81,11 +81,11 @@ class Query implements QueryInterface |
|
|
* @param bool|string|int $value Value which need to check (by default true) |
|
|
* @param bool|string|int $value Value which need to check (by default true) |
|
|
* @param bool|string|int $operator It may be one from list [-,=,>,<] |
|
|
* @param bool|string|int $operator It may be one from list [-,=,>,<] |
|
|
* |
|
|
* |
|
|
* @return \RouterOS\Query |
|
|
|
|
|
|
|
|
* @return \RouterOS\Interfaces\QueryInterface |
|
|
* @throws \RouterOS\Exceptions\QueryException |
|
|
* @throws \RouterOS\Exceptions\QueryException |
|
|
* @since 1.0.0 |
|
|
* @since 1.0.0 |
|
|
*/ |
|
|
*/ |
|
|
public function where(string $key, $operator = null, $value = null): self |
|
|
|
|
|
|
|
|
public function where(string $key, $operator = null, $value = null): QueryInterface |
|
|
{ |
|
|
{ |
|
|
return $this->world('?' . $key, $operator, $value); |
|
|
return $this->world('?' . $key, $operator, $value); |
|
|
} |
|
|
} |
|
|
@ -96,11 +96,11 @@ class Query implements QueryInterface |
|
|
* @param string $key Key which need to find |
|
|
* @param string $key Key which need to find |
|
|
* @param bool|string|int $value Value which need to check (by default true) |
|
|
* @param bool|string|int $value Value which need to check (by default true) |
|
|
* |
|
|
* |
|
|
* @return \RouterOS\Query |
|
|
|
|
|
|
|
|
* @return \RouterOS\Interfaces\QueryInterface |
|
|
* @throws \RouterOS\Exceptions\QueryException |
|
|
* @throws \RouterOS\Exceptions\QueryException |
|
|
* @since 1.1 |
|
|
* @since 1.1 |
|
|
*/ |
|
|
*/ |
|
|
public function equal(string $key, $value = null): self |
|
|
|
|
|
|
|
|
public function equal(string $key, $value = null): QueryInterface |
|
|
{ |
|
|
{ |
|
|
return $this->world('=' . $key, null, $value); |
|
|
return $this->world('=' . $key, null, $value); |
|
|
} |
|
|
} |
|
|
@ -112,10 +112,10 @@ class Query implements QueryInterface |
|
|
* @param bool|string|int $value Value which need to check (by default true) |
|
|
* @param bool|string|int $value Value which need to check (by default true) |
|
|
* @param bool|string|int $operator It may be one from list [-,=,>,<] |
|
|
* @param bool|string|int $operator It may be one from list [-,=,>,<] |
|
|
* |
|
|
* |
|
|
* @return \RouterOS\Query |
|
|
|
|
|
|
|
|
* @return \RouterOS\Interfaces\QueryInterface |
|
|
* @throws \RouterOS\Exceptions\QueryException |
|
|
* @throws \RouterOS\Exceptions\QueryException |
|
|
*/ |
|
|
*/ |
|
|
private function world(string $key, $operator = null, $value = null): self |
|
|
|
|
|
|
|
|
private function world(string $key, $operator = null, $value = null): QueryInterface |
|
|
{ |
|
|
{ |
|
|
if (null !== $operator && null === $value) { |
|
|
if (null !== $operator && null === $value) { |
|
|
|
|
|
|
|
|
@ -148,10 +148,10 @@ class Query implements QueryInterface |
|
|
* |
|
|
* |
|
|
* @param string $operations |
|
|
* @param string $operations |
|
|
* |
|
|
* |
|
|
* @return \RouterOS\Query |
|
|
|
|
|
|
|
|
* @return \RouterOS\Interfaces\QueryInterface |
|
|
* @since 1.0.0 |
|
|
* @since 1.0.0 |
|
|
*/ |
|
|
*/ |
|
|
public function operations(string $operations): self |
|
|
|
|
|
|
|
|
public function operations(string $operations): QueryInterface |
|
|
{ |
|
|
{ |
|
|
$this->_operations = '?#' . $operations; |
|
|
$this->_operations = '?#' . $operations; |
|
|
return $this; |
|
|
return $this; |
|
|
@ -162,10 +162,10 @@ class Query implements QueryInterface |
|
|
* |
|
|
* |
|
|
* @param string $name |
|
|
* @param string $name |
|
|
* |
|
|
* |
|
|
* @return \RouterOS\Query |
|
|
|
|
|
|
|
|
* @return \RouterOS\Interfaces\QueryInterface |
|
|
* @since 1.0.0 |
|
|
* @since 1.0.0 |
|
|
*/ |
|
|
*/ |
|
|
public function tag(string $name): self |
|
|
|
|
|
|
|
|
public function tag(string $name): QueryInterface |
|
|
{ |
|
|
{ |
|
|
$this->_tag = '.tag=' . $name; |
|
|
$this->_tag = '.tag=' . $name; |
|
|
return $this; |
|
|
return $this; |
|
|
@ -176,9 +176,9 @@ class Query implements QueryInterface |
|
|
* |
|
|
* |
|
|
* @param string $word |
|
|
* @param string $word |
|
|
* |
|
|
* |
|
|
* @return \RouterOS\Query |
|
|
|
|
|
|
|
|
* @return \RouterOS\Interfaces\QueryInterface |
|
|
*/ |
|
|
*/ |
|
|
public function add(string $word): Query |
|
|
|
|
|
|
|
|
public function add(string $word): QueryInterface |
|
|
{ |
|
|
{ |
|
|
$this->_attributes[] = $word; |
|
|
$this->_attributes[] = $word; |
|
|
return $this; |
|
|
return $this; |
|
|
@ -199,10 +199,10 @@ class Query implements QueryInterface |
|
|
* |
|
|
* |
|
|
* @param array $attributes |
|
|
* @param array $attributes |
|
|
* |
|
|
* |
|
|
* @return \RouterOS\Query |
|
|
|
|
|
|
|
|
* @return \RouterOS\Interfaces\QueryInterface |
|
|
* @since 0.7 |
|
|
* @since 0.7 |
|
|
*/ |
|
|
*/ |
|
|
public function setAttributes(array $attributes): Query |
|
|
|
|
|
|
|
|
public function setAttributes(array $attributes): QueryInterface |
|
|
{ |
|
|
{ |
|
|
$this->_attributes = $attributes; |
|
|
$this->_attributes = $attributes; |
|
|
return $this; |
|
|
return $this; |
|
|
@ -213,7 +213,7 @@ class Query implements QueryInterface |
|
|
* |
|
|
* |
|
|
* @return string|null |
|
|
* @return string|null |
|
|
*/ |
|
|
*/ |
|
|
public function getEndpoint() |
|
|
|
|
|
|
|
|
public function getEndpoint(): ?string |
|
|
{ |
|
|
{ |
|
|
return $this->_endpoint; |
|
|
return $this->_endpoint; |
|
|
} |
|
|
} |
|
|
@ -223,10 +223,10 @@ class Query implements QueryInterface |
|
|
* |
|
|
* |
|
|
* @param string|null $endpoint |
|
|
* @param string|null $endpoint |
|
|
* |
|
|
* |
|
|
* @return \RouterOS\Query |
|
|
|
|
|
|
|
|
* @return \RouterOS\Interfaces\QueryInterface |
|
|
* @since 0.7 |
|
|
* @since 0.7 |
|
|
*/ |
|
|
*/ |
|
|
public function setEndpoint(string $endpoint = null): Query |
|
|
|
|
|
|
|
|
public function setEndpoint(string $endpoint = null): QueryInterface |
|
|
{ |
|
|
{ |
|
|
$this->_endpoint = $endpoint; |
|
|
$this->_endpoint = $endpoint; |
|
|
return $this; |
|
|
return $this; |
|
|
|