Skip to content

Commit

Permalink
dded serializable model example
Browse files Browse the repository at this point in the history
  • Loading branch information
wickedOne committed Dec 28, 2020
1 parent 514eec5 commit f453f23
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions src/Manager/Model/Property.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php

declare(strict_types=1);

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,
];
}
}

0 comments on commit f453f23

Please sign in to comment.