-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the Eloo API. | ||
* (c) Eloo <[email protected]> | ||
* This source file is subject to the Trade Secret license. | ||
*/ | ||
|
||
namespace Solarium\Manager\Model; | ||
|
||
/** | ||
* Property. | ||
* | ||
* @author wicliff <[email protected]> | ||
*/ | ||
class Property implements \JsonSerializable | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
private $name; | ||
|
||
/** | ||
* @var mixed | ||
*/ | ||
private $value; | ||
|
||
/** | ||
* @param string $name | ||
* @param mixed $value | ||
*/ | ||
public function __construct(string $name, $value = null) | ||
{ | ||
$this->name = $name; | ||
$this->value = $value; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getName(): string | ||
{ | ||
return $this->name; | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getValue() | ||
{ | ||
return $this->value; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function jsonSerialize() | ||
{ | ||
return [ | ||
$this->name => $this->value, | ||
]; | ||
} | ||
} |