1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
<?php
namespace Gedcomx\Common;
use Gedcomx\Support\HasJsonKey;
/**
* Class CustomKeyedItem
* @package Gedcomx\Common
*
* A class to support custom item definitions
*/
class CustomKeyedItem implements HasJsonKey
{
/**
* @var string
*/
private $key;
/**
* @var mixed
*/
private $val1;
/**
* @var mixed
*/
private $val2;
/**
* Create a new CustomKeyedItem and initialize the id with a GUID
*/
public function __construct()
{
$this->key = guid();
}
/**
* @return bool
*/
public function isHasUniqueKey()
{
return false;
}
/**
* Return the key value for a JSON string
*
* @return mixed
*/
public function getJsonKey()
{
return $this->getKey();
}
/**
* Set the key value for a JSON string
*
* @param string $jsonKey
*/
public function setJsonKey($jsonKey)
{
$this->setKey($jsonKey);
}
/**
* Return the key value for this object
*
* @return string
*/
public function getKey()
{
return $this->key;
}
/**
* Set the key value for this object
*
* @param string $key
*/
public function setKey($key)
{
$this->key = $key;
}
/**
* Return the first value of this object
*
* @return mixed
*/
public function getVal1()
{
return $this->val1;
}
/**
* Set the first value of this object
*
* @param $val1
*/
public function setVal1($val1)
{
$this->val1 = $val1;
}
/**
* Return the second value of this object
*
* @return mixed
*/
public function getVal2()
{
return $this->val2;
}
/**
* Set the second value of this object
*
* @param mixed $val2
*/
public function setVal2($val2)
{
$this->val2 = $val2;
}
}