vendor/friendsofsymfony/rest-bundle/Controller/Annotations/View.php line 22

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the FOSRestBundle package.
  4.  *
  5.  * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace FOS\RestBundle\Controller\Annotations;
  11. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  12. /**
  13.  * View annotation class.
  14.  *
  15.  * @Annotation
  16.  * @Target({"METHOD","CLASS"})
  17.  */
  18. class View extends Template
  19. {
  20.     /**
  21.      * @var string
  22.      */
  23.     protected $templateVar;
  24.     /**
  25.      * @var int
  26.      */
  27.     protected $statusCode;
  28.     /**
  29.      * @var array
  30.      */
  31.     protected $serializerGroups;
  32.     /**
  33.      * @var bool
  34.      */
  35.     protected $populateDefaultVars true;
  36.     /**
  37.      * @var bool
  38.      */
  39.     protected $serializerEnableMaxDepthChecks;
  40.     /**
  41.      * Sets the template var name to be used for templating formats.
  42.      *
  43.      * @deprecated since 2.8
  44.      *
  45.      * @param string $templateVar
  46.      */
  47.     public function setTemplateVar($templateVar)
  48.     {
  49.         if (=== func_num_args() || func_get_arg(1)) {
  50.             @trigger_error(sprintf('The %s() method is deprecated since FOSRestBundle 2.8.'__METHOD__), E_USER_DEPRECATED);
  51.         }
  52.         $this->templateVar $templateVar;
  53.     }
  54.     /**
  55.      * Returns the template var name to be used for templating formats.
  56.      *
  57.      * @deprecated since 2.8
  58.      *
  59.      * @return string
  60.      */
  61.     public function getTemplateVar()
  62.     {
  63.         if (=== func_num_args() || func_get_arg(0)) {
  64.             @trigger_error(sprintf('The %s() method is deprecated since FOSRestBundle 2.8.'__METHOD__), E_USER_DEPRECATED);
  65.         }
  66.         return $this->templateVar;
  67.     }
  68.     /**
  69.      * @param int $statusCode
  70.      */
  71.     public function setStatusCode($statusCode)
  72.     {
  73.         $this->statusCode $statusCode;
  74.     }
  75.     /**
  76.      * @return int
  77.      */
  78.     public function getStatusCode()
  79.     {
  80.         return $this->statusCode;
  81.     }
  82.     /**
  83.      * @param array $serializerGroups
  84.      */
  85.     public function setSerializerGroups($serializerGroups)
  86.     {
  87.         $this->serializerGroups $serializerGroups;
  88.     }
  89.     /**
  90.      * @return array
  91.      */
  92.     public function getSerializerGroups()
  93.     {
  94.         return $this->serializerGroups;
  95.     }
  96.     /**
  97.      * @deprecated since 2.8
  98.      *
  99.      * @param bool $populateDefaultVars
  100.      */
  101.     public function setPopulateDefaultVars($populateDefaultVars)
  102.     {
  103.         if (=== func_num_args() || func_get_arg(1)) {
  104.             @trigger_error(sprintf('The %s() method is deprecated since FOSRestBundle 2.8.'__METHOD__), E_USER_DEPRECATED);
  105.         }
  106.         $this->populateDefaultVars = (bool) $populateDefaultVars;
  107.     }
  108.     /**
  109.      * @deprecated since 2.8
  110.      *
  111.      * @return bool
  112.      */
  113.     public function isPopulateDefaultVars()
  114.     {
  115.         if (=== func_num_args() || func_get_arg(0)) {
  116.             @trigger_error(sprintf('The %s() method is deprecated since FOSRestBundle 2.8.'__METHOD__), E_USER_DEPRECATED);
  117.         }
  118.         return $this->populateDefaultVars;
  119.     }
  120.     /**
  121.      * @param bool $serializerEnableMaxDepthChecks
  122.      */
  123.     public function setSerializerEnableMaxDepthChecks($serializerEnableMaxDepthChecks)
  124.     {
  125.         $this->serializerEnableMaxDepthChecks $serializerEnableMaxDepthChecks;
  126.     }
  127.     /**
  128.      * @return bool
  129.      */
  130.     public function getSerializerEnableMaxDepthChecks()
  131.     {
  132.         return $this->serializerEnableMaxDepthChecks;
  133.     }
  134. }