vendor/sulu/sulu/src/Sulu/Bundle/ContactBundle/Entity/Position.php line 19
<?php
/*
* This file is part of Sulu.
*
* (c) Sulu GmbH
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Sulu\Bundle\ContactBundle\Entity;
use JMS\Serializer\Annotation\Groups;
/**
* Position.
*/
class Position implements \JsonSerializable
{
public const RESOURCE_KEY = 'contact_positions';
/**
* @var string
*
* @Groups({"fullContact", "partialContact"})
*/
private $position;
/**
* @var int
*
* @Groups({"fullContact", "partialContact"})
*/
private $id;
/**
* Set position.
*
* @param string $position
*
* @return Position
*/
public function setPosition($position)
{
$this->position = $position;
return $this;
}
/**
* Get position.
*
* @return string
*/
public function getPosition()
{
return $this->position;
}
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* (PHP 5 >= 5.4.0)<br/>
* Specify data which should be serialized to JSON.
*
* @see http://php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed data which can be serialized by <b>json_encode</b>,
* which is a value of any type other than a resource
*/
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return [
'id' => $this->getId(),
'position' => $this->getPosition(),
];
}
}