mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 11:33:17 +00:00

- Squashed Pull request #1730 - Squashed Pull request #1741 - Squashed Pull request #1742 - Squash merge branch 4.0 - Squashed Pull request #1744 - Squashed Pull request #1746 - Squashed merge branch 4.0 - Squashed merge branch 4.0 - Squashed merge branch 4.0 - Squashed merge branch 4.0 - Squashed Pull request #1758 - Avoid using imagine/imagine alias as it is causing install issues - Squashed merge branch 4.0 - Squashed Pull request #1763 - Squashed merge branch 4.0 - Squash of 6 commits - Squashed merge branch 4.0 - This is a combination of 2 commits. - Squashed Pull request #1775 - Squashed Pull request #1777 - Squashed Pull request #1779 - Squashed Pull request #1780 - Squashed Pull request #1782 - Adds a Pull request template - Squased Pull request #1783 - Squash Pull request #1786 - Squashed Pull request #1796 - Squashed merge branch 4.0 - Squash Pull request #1791 - Squashed merge branch 4.0 - Squashed Pull request #1808 - Squashed Pull request #1811 - Squashed Pull request #1809
92 lines
1.8 KiB
PHP
92 lines
1.8 KiB
PHP
<?php
|
|
/*
|
|
* This file is part of Phraseanet
|
|
*
|
|
* (c) 2005-2016 Alchemy
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Alchemy\Phrasea\Vocabulary;
|
|
|
|
use Alchemy\Phrasea\Vocabulary\ControlProvider\ControlProviderInterface;
|
|
use Assert\Assertion;
|
|
|
|
class Term
|
|
{
|
|
/**
|
|
* @var string
|
|
*/
|
|
protected $value;
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
protected $context;
|
|
|
|
/**
|
|
* @var ControlProviderInterface
|
|
*/
|
|
protected $type;
|
|
|
|
/**
|
|
* @var mixed
|
|
*/
|
|
protected $id;
|
|
|
|
/**
|
|
* Construct a Term
|
|
*
|
|
* @param string $value the scalar value of the Term
|
|
* @param string $context A string defining the context of the Term
|
|
* @param ControlProviderInterface $type A Vocabulary Controller
|
|
* @param mixed $id The id of the term in the Vocabulary Controller
|
|
*/
|
|
public function __construct($value, $context = null, ControlProviderInterface $type = null, $id = null)
|
|
{
|
|
Assertion::string($value, 'A Term value should be a string');
|
|
|
|
$this->value = $value;
|
|
$this->context = $context;
|
|
$this->type = $type;
|
|
$this->id = $id;
|
|
}
|
|
|
|
/**
|
|
* Get the scalar value of a term
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getValue()
|
|
{
|
|
return $this->value;
|
|
}
|
|
|
|
/**
|
|
* Get the content of a term
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getContext()
|
|
{
|
|
return $this->context;
|
|
}
|
|
|
|
/**
|
|
* @return ControlProviderInterface
|
|
*/
|
|
public function getType()
|
|
{
|
|
return $this->type;
|
|
}
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function getId()
|
|
{
|
|
return $this->id;
|
|
}
|
|
}
|