ArrayPrimitiveTrait.php 3.34 KB
Newer Older
Ketan's avatar
Ketan committed
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 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
<?php
/**
 * File ArrayPrimitiveTrait.php
 *
 * @author Edward Pfremmer <epfremme@nerdery.com>
 */
namespace Epfremme\Swagger\Entity\Mixin\Primitives;

use Epfremme\Swagger\Entity\Schemas\SchemaInterface;
use JMS\Serializer\Annotation as JMS;

/**
 * Trait ArrayPrimitiveTrait
 *
 * @package Epfremme\Swagger
 * @subpackage Entity\Schemas\Primitives
 */
trait ArrayPrimitiveTrait
{
    use AnyPrimitiveTrait;

    /**
     * @JMS\Since("2.0")
     * @JMS\Type("Epfremme\Swagger\Entity\Schemas\AbstractSchema")
     * @JMS\SerializedName("items")
     * @var SchemaInterface
     */
    protected $items;

    /**
     * @JMS\Since("2.0")
     * @JMS\Type("boolean")
     * @JMS\SerializedName("additionalItems")
     * @var boolean
     */
    protected $additionalItems;

    /**
     * @JMS\Since("2.0")
     * @JMS\Type("integer")
     * @JMS\SerializedName("maxItems")
     * @var integer
     */
    protected $maxItems;

    /**
     * @JMS\Since("2.0")
     * @JMS\Type("integer")
     * @JMS\SerializedName("minItems")
     * @var integer
     */
    protected $minItems;

    /**
     * @JMS\Since("2.0")
     * @JMS\Type("boolean")
     * @JMS\SerializedName("uniqueItems")
     * @var boolean
     */
    protected $uniqueItems;

    /**
     * @JMS\Since("2.0")
     * @JMS\Type("string")
     * @JMS\SerializedName("collectionFormat")
     * @var string
     */
    protected $collectionFormat;

    /**
     * @return SchemaInterface
     */
    public function getItems()
    {
        return $this->items;
    }

    /**
     * @param SchemaInterface $items
     * @return ArrayPrimitiveTrait
     */
    public function setItems(SchemaInterface $items)
    {
        $this->items = $items;
        return $this;
    }

    /**
     * @return boolean
     */
    public function isAdditionalItems()
    {
        return $this->additionalItems;
    }

    /**
     * @param boolean $additionalItems
     * @return ArrayPrimitiveTrait
     */
    public function setAdditionalItems($additionalItems)
    {
        $this->additionalItems = $additionalItems;
        return $this;
    }

    /**
     * @return int
     */
    public function getMaxItems()
    {
        return $this->maxItems;
    }

    /**
     * @param int $maxItems
     * @return ArrayPrimitiveTrait
     */
    public function setMaxItems($maxItems)
    {
        $this->maxItems = $maxItems;
        return $this;
    }

    /**
     * @return int
     */
    public function getMinItems()
    {
        return $this->minItems;
    }

    /**
     * @param int $minItems
     * @return ArrayPrimitiveTrait
     */
    public function setMinItems($minItems)
    {
        $this->minItems = $minItems;
        return $this;
    }

    /**
     * @return boolean
     */
    public function isUniqueItems()
    {
        return $this->uniqueItems;
    }

    /**
     * @param boolean $uniqueItems
     * @return ArrayPrimitiveTrait
     */
    public function setUniqueItems($uniqueItems)
    {
        $this->uniqueItems = $uniqueItems;
        return $this;
    }

    /**
     * @return string
     */
    public function getCollectionFormat()
    {
        return $this->collectionFormat;
    }

    /**
     * @param string $collectionFormat
     * @return ArrayPrimitiveTrait
     */
    public function setCollectionFormat($collectionFormat)
    {
        $this->collectionFormat = $collectionFormat;
        return $this;
    }
}