for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @link https://github.com/old-town/old-town-propertyset
* @author Malofeykin Andrey <[email protected]>
*/
namespace OldTown\PropertySet;
* Class PropertySetSchema
*
* @package OldTown\PropertySet
class PropertySetSchema
{
* @var PropertySchema[]
protected $propertySchemas = [];
* @var bool
protected $restricted = false;
* @param string $key
* @return PropertySchema|null
public function getPropertySchema($key)
$key = (string)$key;
if (!array_key_exists($key, $this->propertySchemas)) {
return null;
}
return $this->propertySchemas[$key];
* @param PropertySchema $ps
* @return $this
public function setPropertySchema($key, PropertySchema $ps)
if (null !== $ps->getPropertyName()) {
$ps->setPropertyName($key);
$this->propertySchemas[$key] = $ps;
return $this;
public function addPropertySchema(PropertySchema $ps)
$key = (string)$ps->getPropertyName();
* @return boolean
public function isRestricted()
return $this->restricted;
* @param boolean $restricted
public function setRestricted($restricted)
$this->restricted = (boolean)$restricted;