vendor/sg/datatablesbundle/Datatable/Column/AbstractColumn.php line 385

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the SgDatatablesBundle package.
  4.  *
  5.  * (c) stwe <https://github.com/stwe/DatatablesBundle>
  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 Sg\DatatablesBundle\Datatable\Column;
  11. use Doctrine\DBAL\Types\Type as DoctrineType;
  12. use Doctrine\ORM\Mapping\ClassMetadataInfo;
  13. use Exception;
  14. use Sg\DatatablesBundle\Datatable\AddIfTrait;
  15. use Sg\DatatablesBundle\Datatable\Editable\EditableInterface;
  16. use Sg\DatatablesBundle\Datatable\OptionsTrait;
  17. use Symfony\Component\OptionsResolver\OptionsResolver;
  18. use Symfony\Component\Routing\RouterInterface;
  19. use Twig\Environment;
  20. abstract class AbstractColumn implements ColumnInterface
  21. {
  22.     // Use an 'add_if' option to check in ColumnBuilder if the Column can be added.
  23.     use AddIfTrait;
  24.     use OptionsTrait;
  25.     //-------------------------------------------------
  26.     // Column Types
  27.     //-------------------------------------------------
  28.     /**
  29.      * Identifies a Data Column.
  30.      */
  31.     public const DATA_COLUMN = 'data';
  32.     /**
  33.      * Identifies an Action Column.
  34.      */
  35.     public const ACTION_COLUMN = 'action';
  36.     /**
  37.      * Identifies a Multiselect Column.
  38.      */
  39.     public const MULTISELECT_COLUMN = 'multiselect';
  40.     /**
  41.      * Identifies a Virtual Column.
  42.      */
  43.     public const VIRTUAL_COLUMN = 'virtual';
  44.     //--------------------------------------------------------------------------------------------------
  45.     // DataTables - Columns Options
  46.     // ----------------------------
  47.     // All Column Options are initialized with 'null' - except 'searchable', 'orderable', and 'visible'.
  48.     // These 'null' initialized options uses the default value of the DataTables plugin.
  49.     // 'searchable', 'orderable', and 'visible' are required in the QueryBuilder and are therefore
  50.     // pre-assigned with a value (true or false).
  51.     //--------------------------------------------------------------------------------------------------
  52.     /**
  53.      * Change the cell type created for the column - either TD cells or TH cells.
  54.      * DataTables default: td
  55.      * Default: null.
  56.      *
  57.      * @var string|null
  58.      */
  59.     protected $cellType;
  60.     /**
  61.      * Adds a class to each cell in a column.
  62.      * Default: null.
  63.      *
  64.      * @var string|null
  65.      */
  66.     protected $className;
  67.     /**
  68.      * Add padding to the text content used when calculating the optimal with for a table.
  69.      * Default: null.
  70.      *
  71.      * @var string|null
  72.      */
  73.     protected $contentPadding;
  74.     /**
  75.      * Set the data source for the column from the rows data object / array.
  76.      * DataTables default: Takes the index value of the column automatically.
  77.      *
  78.      * This property has normally the same value as $this->dql.
  79.      * Is set in the ColumnBuilder.
  80.      *
  81.      * @var string|null
  82.      */
  83.     protected $data;
  84.     /**
  85.      * Set default, static, content for a column.
  86.      * Show an information message for a field that can have a 'null' or 'undefined' value.
  87.      * Default: null.
  88.      *
  89.      * @var string|null
  90.      */
  91.     protected $defaultContent;
  92.     /**
  93.      * Set a descriptive name for a column. Only needed when working with DataTables' API.
  94.      * Default: null.
  95.      *
  96.      * @var string|null
  97.      */
  98.     protected $name;
  99.     /**
  100.      * Enable or disable ordering on this column.
  101.      * DataTables default: true
  102.      * Default: true.
  103.      *
  104.      * @var bool
  105.      */
  106.     protected $orderable;
  107.     /**
  108.      * Define multiple column ordering as the default order for a column.
  109.      * DataTables default: Takes the index value of the column automatically.
  110.      * Default: null.
  111.      *
  112.      * @var array|int|null
  113.      */
  114.     protected $orderData;
  115.     /**
  116.      * Order direction application sequence.
  117.      * DataTables default: ['asc', 'desc']
  118.      * Default: null.
  119.      *
  120.      * @var array|null
  121.      */
  122.     protected $orderSequence;
  123.     /**
  124.      * Enable or disable filtering on the data in this column.
  125.      * DataTables default: true
  126.      * Default: true.
  127.      *
  128.      * @var bool
  129.      */
  130.     protected $searchable;
  131.     /**
  132.      * Set the column title.
  133.      * DataTables default: Value read from the column's header cell.
  134.      * Default: null.
  135.      *
  136.      * @var string|null
  137.      */
  138.     protected $title;
  139.     /**
  140.      * Enable or disable the display of this column.
  141.      * DataTables default: true
  142.      * Default: true.
  143.      *
  144.      * @var bool
  145.      */
  146.     protected $visible;
  147.     /**
  148.      * Column width assignment.
  149.      * DataTables default: Auto-detected from the table's content.
  150.      * Default: null.
  151.      *
  152.      * @var string|null
  153.      */
  154.     protected $width;
  155.     //-------------------------------------------------
  156.     // Custom Options
  157.     //-------------------------------------------------
  158.     /**
  159.      * Join type (default: 'leftJoin'), if the column represents an association.
  160.      * Default: 'leftJoin'.
  161.      *
  162.      * @var string
  163.      */
  164.     protected $joinType;
  165.     /**
  166.      * The data type of the column.
  167.      * Is set automatically in ColumnBuilder when 'null'.
  168.      * Default: null.
  169.      *
  170.      * @var string|null
  171.      */
  172.     protected $typeOfField;
  173.     /**
  174.      * The first argument of ColumnBuilders 'add' function.
  175.      * The DatatableQuery class works with this property.
  176.      * If $dql is used as an option, the ColumnBuilder sets $customDql to true.
  177.      *
  178.      * @var string|null
  179.      */
  180.     protected $dql;
  181.     //-------------------------------------------------
  182.     // Extensions Options
  183.     //-------------------------------------------------
  184.     /**
  185.      * Set column's visibility priority.
  186.      * Requires the Responsive extension.
  187.      * Default: null.
  188.      *
  189.      * @var int|null
  190.      */
  191.     protected $responsivePriority;
  192.     //-------------------------------------------------
  193.     // Other Properties
  194.     //-------------------------------------------------
  195.     /**
  196.      * True if DQL option is provided.
  197.      * Is set in the ColumnBuilder.
  198.      *
  199.      * @var bool
  200.      */
  201.     protected $customDql;
  202.     /**
  203.      * The Twig Environment to render Twig templates in Column rowes.
  204.      * Is set in the ColumnBuilder.
  205.      *
  206.      * @var Twig_Environment
  207.      */
  208.     protected $twig;
  209.     /**
  210.      * The Router.
  211.      * Is set in the ColumnBuilder.
  212.      *
  213.      * @var RouterInterface
  214.      */
  215.     protected $router;
  216.     /**
  217.      * The position in the Columns array.
  218.      * Is set in the ColumnBuilder.
  219.      *
  220.      * @var int
  221.      */
  222.     protected $index;
  223.     /**
  224.      * The name of the associated Datatable.
  225.      * Is set in the ColumnBuilder.
  226.      *
  227.      * @var string
  228.      */
  229.     protected $datatableName;
  230.     /**
  231.      * The fully-qualified class name of the entity (e.g. AppBundle\Entity\Post).
  232.      * Is set in the ColumnBuilder.
  233.      *
  234.      * @var string
  235.      */
  236.     protected $entityClassName;
  237.     /**
  238.      * The type of association.
  239.      * Is set in the ColumnBuilder.
  240.      *
  241.      * @var array|null
  242.      */
  243.     protected $typeOfAssociation;
  244.     /**
  245.      * Saves the original type of field for the DatatableController editAction.
  246.      * Is set in the ColumnBuilder.
  247.      *
  248.      * @var string|null
  249.      */
  250.     protected $originalTypeOfField;
  251.     /**
  252.      * If the field is sent in the response, to show in the webpage
  253.      * Is set in the ColumnBuilder.
  254.      * Default: true.
  255.      *
  256.      * @var bool
  257.      */
  258.     protected $sentInResponse;
  259.     //-------------------------------------------------
  260.     // Options
  261.     //-------------------------------------------------
  262.     /**
  263.      * @return $this
  264.      */
  265.     public function configureOptions(OptionsResolver $resolver)
  266.     {
  267.         // 'dql' and 'data' options need no default value
  268.         $resolver->setDefined(['dql', 'data']);
  269.         $resolver->setDefaults([
  270.             'cell_type' => null,
  271.             'class_name' => null,
  272.             'content_padding' => null,
  273.             'default_content' => null,
  274.             'name' => null,
  275.             'orderable' => true,
  276.             'order_data' => null,
  277.             'order_sequence' => null,
  278.             'searchable' => true,
  279.             'title' => null,
  280.             'visible' => true,
  281.             'width' => null,
  282.             'add_if' => null,
  283.             'join_type' => 'leftJoin',
  284.             'type_of_field' => null,
  285.             'responsive_priority' => null,
  286.             'sent_in_response' => true,
  287.         ]);
  288.         $resolver->setAllowedTypes('cell_type', ['null', 'string']);
  289.         $resolver->setAllowedTypes('class_name', ['null', 'string']);
  290.         $resolver->setAllowedTypes('content_padding', ['null', 'string']);
  291.         $resolver->setAllowedTypes('dql', ['null', 'string']);
  292.         $resolver->setAllowedTypes('data', ['null', 'string']);
  293.         $resolver->setAllowedTypes('default_content', ['null', 'string']);
  294.         $resolver->setAllowedTypes('name', ['null', 'string']);
  295.         $resolver->setAllowedTypes('orderable', 'bool');
  296.         $resolver->setAllowedTypes('order_data', ['null', 'array', 'int']);
  297.         $resolver->setAllowedTypes('order_sequence', ['null', 'array']);
  298.         $resolver->setAllowedTypes('searchable', 'bool');
  299.         $resolver->setAllowedTypes('title', ['null', 'string']);
  300.         $resolver->setAllowedTypes('visible', 'bool');
  301.         $resolver->setAllowedTypes('width', ['null', 'string']);
  302.         $resolver->setAllowedTypes('add_if', ['null', 'Closure']);
  303.         $resolver->setAllowedTypes('join_type', 'string');
  304.         $resolver->setAllowedTypes('type_of_field', ['null', 'string']);
  305.         $resolver->setAllowedTypes('responsive_priority', ['null', 'int']);
  306.         $resolver->setAllowedTypes('sent_in_response', ['bool']);
  307.         $resolver->setAllowedValues('cell_type', [null, 'th', 'td']);
  308.         $resolver->setAllowedValues('join_type', [null, 'join', 'leftJoin', 'innerJoin']);
  309.         $resolver->setAllowedValues('type_of_field', array_merge([null], array_keys(DoctrineType::getTypesMap())));
  310.         return $this;
  311.     }
  312.     //-------------------------------------------------
  313.     // ColumnInterface
  314.     //-------------------------------------------------
  315.     /**
  316.      * {@inheritdoc}
  317.      */
  318.     public function dqlConstraint($dql)
  319.     {
  320.         if (true === $this->isCustomDql()) {
  321.             return true;
  322.         }
  323.         return preg_match('/^[a-zA-Z0-9_\\-\\.]+$/', $dql) ? true : false;
  324.     }
  325.     /**
  326.      * {@inheritdoc}
  327.      */
  328.     public function isUnique()
  329.     {
  330.         return false;
  331.     }
  332.     /**
  333.      * {@inheritdoc}
  334.      */
  335.     public function isAssociation()
  336.     {
  337.         return false === strstr($this->dql, '.') ? false : true;
  338.     }
  339.     /**
  340.      * {@inheritdoc}
  341.      */
  342.     public function isToManyAssociation()
  343.     {
  344.         if (true === $this->isAssociation() && null !== $this->typeOfAssociation) {
  345.             if (\in_array(ClassMetadataInfo::ONE_TO_MANY, $this->typeOfAssociation, true) || \in_array(ClassMetadataInfo::MANY_TO_MANY, $this->typeOfAssociation, true)) {
  346.                 return true;
  347.             }
  348.             return false;
  349.         }
  350.         return false;
  351.     }
  352.     /**
  353.      * {@inheritdoc}
  354.      */
  355.     public function isSelectColumn()
  356.     {
  357.         return true;
  358.     }
  359.     /**
  360.      * {@inheritdoc}
  361.      */
  362.     public function getOptionsTemplate()
  363.     {
  364.         return '@SgDatatables/column/column.html.twig';
  365.     }
  366.     /**
  367.      * {@inheritdoc}
  368.      */
  369.     public function addDataToOutputArray(array &$row)
  370.     {
  371.         return null;
  372.     }
  373.     /**
  374.      * {@inheritdoc}
  375.      */
  376.     public function renderCellContent(array &$row)
  377.     {
  378.         $this->isToManyAssociation() ? $this->renderToMany($row) : $this->renderSingleField($row);
  379.     }
  380.     /**
  381.      * {@inheritdoc}
  382.      */
  383.     public function renderPostCreateDatatableJsContent()
  384.     {
  385.         return null;
  386.     }
  387.     /**
  388.      * {@inheritdoc}
  389.      */
  390.     public function allowedPositions()
  391.     {
  392.         return null;
  393.     }
  394.     /**
  395.      * {@inheritdoc}
  396.      */
  397.     public function getColumnType()
  398.     {
  399.         return self::DATA_COLUMN;
  400.     }
  401.     /**
  402.      * {@inheritdoc}
  403.      */
  404.     public function isEditableContentRequired(array $row)
  405.     {
  406.         if (isset($this->editable)) {
  407.             if ($this->editable instanceof EditableInterface && true === $this->editable->callEditableIfClosure($row)) {
  408.                 return true;
  409.             }
  410.         }
  411.         return false;
  412.     }
  413.     //-------------------------------------------------
  414.     // Getters && Setters
  415.     //-------------------------------------------------
  416.     /**
  417.      * @return string|null
  418.      */
  419.     public function getCellType()
  420.     {
  421.         return $this->cellType;
  422.     }
  423.     /**
  424.      * @param string|null $cellType
  425.      *
  426.      * @return $this
  427.      */
  428.     public function setCellType($cellType)
  429.     {
  430.         $this->cellType = $cellType;
  431.         return $this;
  432.     }
  433.     /**
  434.      * @return string|null
  435.      */
  436.     public function getClassName()
  437.     {
  438.         return $this->className;
  439.     }
  440.     /**
  441.      * @param string|null $className
  442.      *
  443.      * @return $this
  444.      */
  445.     public function setClassName($className)
  446.     {
  447.         $this->className = $className;
  448.         return $this;
  449.     }
  450.     /**
  451.      * @return string|null
  452.      */
  453.     public function getContentPadding()
  454.     {
  455.         return $this->contentPadding;
  456.     }
  457.     /**
  458.      * @param string|null $contentPadding
  459.      *
  460.      * @return $this
  461.      */
  462.     public function setContentPadding($contentPadding)
  463.     {
  464.         $this->contentPadding = $contentPadding;
  465.         return $this;
  466.     }
  467.     /**
  468.      * @return string|null
  469.      */
  470.     public function getData()
  471.     {
  472.         return $this->data;
  473.     }
  474.     /**
  475.      * @param string|null $data
  476.      *
  477.      * @return $this
  478.      */
  479.     public function setData($data)
  480.     {
  481.         $this->data = $data;
  482.         return $this;
  483.     }
  484.     /**
  485.      * @return string|null
  486.      */
  487.     public function getDefaultContent()
  488.     {
  489.         return $this->defaultContent;
  490.     }
  491.     /**
  492.      * @param string|null $defaultContent
  493.      *
  494.      * @return $this
  495.      */
  496.     public function setDefaultContent($defaultContent)
  497.     {
  498.         $this->defaultContent = $defaultContent;
  499.         return $this;
  500.     }
  501.     /**
  502.      * @return string|null
  503.      */
  504.     public function getName()
  505.     {
  506.         return $this->name;
  507.     }
  508.     /**
  509.      * @param string|null $name
  510.      *
  511.      * @return $this
  512.      */
  513.     public function setName($name)
  514.     {
  515.         $this->name = $name;
  516.         return $this;
  517.     }
  518.     /**
  519.      * @return bool
  520.      */
  521.     public function getOrderable()
  522.     {
  523.         return $this->orderable;
  524.     }
  525.     /**
  526.      * @param bool $orderable
  527.      *
  528.      * @return $this
  529.      */
  530.     public function setOrderable($orderable)
  531.     {
  532.         $this->orderable = $orderable;
  533.         return $this;
  534.     }
  535.     /**
  536.      * @return array|int|null
  537.      */
  538.     public function getOrderData()
  539.     {
  540.         if (\is_array($this->orderData)) {
  541.             return $this->optionToJson($this->orderData);
  542.         }
  543.         return $this->orderData;
  544.     }
  545.     /**
  546.      * @param array|int|null $orderData
  547.      *
  548.      * @return $this
  549.      */
  550.     public function setOrderData($orderData)
  551.     {
  552.         $this->orderData = $orderData;
  553.         return $this;
  554.     }
  555.     /**
  556.      * @return array|null
  557.      */
  558.     public function getOrderSequence()
  559.     {
  560.         if (\is_array($this->orderSequence)) {
  561.             return $this->optionToJson($this->orderSequence);
  562.         }
  563.         return $this->orderSequence;
  564.     }
  565.     /**
  566.      * @param array|null $orderSequence
  567.      *
  568.      * @return $this
  569.      */
  570.     public function setOrderSequence($orderSequence)
  571.     {
  572.         $this->orderSequence = $orderSequence;
  573.         return $this;
  574.     }
  575.     /**
  576.      * @return bool
  577.      */
  578.     public function getSearchable()
  579.     {
  580.         return $this->searchable;
  581.     }
  582.     /**
  583.      * @param bool $searchable
  584.      *
  585.      * @return $this
  586.      */
  587.     public function setSearchable($searchable)
  588.     {
  589.         $this->searchable = $searchable;
  590.         return $this;
  591.     }
  592.     /**
  593.      * @return string|null
  594.      */
  595.     public function getTitle()
  596.     {
  597.         return $this->title;
  598.     }
  599.     /**
  600.      * @param string|null $title
  601.      *
  602.      * @return $this
  603.      */
  604.     public function setTitle($title)
  605.     {
  606.         $this->title = $title;
  607.         return $this;
  608.     }
  609.     /**
  610.      * @return bool
  611.      */
  612.     public function getVisible()
  613.     {
  614.         return $this->visible;
  615.     }
  616.     /**
  617.      * @param bool $visible
  618.      *
  619.      * @return $this
  620.      */
  621.     public function setVisible($visible)
  622.     {
  623.         $this->visible = $visible;
  624.         return $this;
  625.     }
  626.     /**
  627.      * @return string|null
  628.      */
  629.     public function getWidth()
  630.     {
  631.         return $this->width;
  632.     }
  633.     /**
  634.      * @param string|null $width
  635.      *
  636.      * @return $this
  637.      */
  638.     public function setWidth($width)
  639.     {
  640.         $this->width = $width;
  641.         return $this;
  642.     }
  643.     /**
  644.      * Get join type.
  645.      *
  646.      * @return string
  647.      */
  648.     public function getJoinType()
  649.     {
  650.         return $this->joinType;
  651.     }
  652.     /**
  653.      * Set join type.
  654.      *
  655.      * @param string $joinType
  656.      *
  657.      * @return $this
  658.      */
  659.     public function setJoinType($joinType)
  660.     {
  661.         $this->joinType = $joinType;
  662.         return $this;
  663.     }
  664.     /**
  665.      * Get type of field.
  666.      *
  667.      * @return string|null
  668.      */
  669.     public function getTypeOfField()
  670.     {
  671.         return $this->typeOfField;
  672.     }
  673.     /**
  674.      * Set type of field.
  675.      *
  676.      * @param string|null $typeOfField
  677.      *
  678.      * @return $this
  679.      */
  680.     public function setTypeOfField($typeOfField)
  681.     {
  682.         $this->typeOfField = $typeOfField;
  683.         return $this;
  684.     }
  685.     /**
  686.      * @return int|null
  687.      */
  688.     public function getResponsivePriority()
  689.     {
  690.         return $this->responsivePriority;
  691.     }
  692.     /**
  693.      * @param int|null $responsivePriority
  694.      *
  695.      * @return $this
  696.      */
  697.     public function setResponsivePriority($responsivePriority)
  698.     {
  699.         $this->responsivePriority = $responsivePriority;
  700.         return $this;
  701.     }
  702.     /**
  703.      * @return string|null
  704.      */
  705.     public function getDql()
  706.     {
  707.         return $this->dql;
  708.     }
  709.     /**
  710.      * @param string|null $dql
  711.      *
  712.      * @throws Exception
  713.      *
  714.      * @return $this
  715.      */
  716.     public function setDql($dql)
  717.     {
  718.         if (true === $this->dqlConstraint($dql)) {
  719.             $this->dql = $dql;
  720.         } else {
  721.             throw new Exception("AbstractColumn::setDql(): {$dql} is not valid for this Column.");
  722.         }
  723.         return $this;
  724.     }
  725.     /**
  726.      * @return bool
  727.      */
  728.     public function isCustomDql()
  729.     {
  730.         return $this->customDql;
  731.     }
  732.     /**
  733.      * @param bool $customDql
  734.      *
  735.      * @return $this
  736.      */
  737.     public function setCustomDql($customDql)
  738.     {
  739.         $this->customDql = $customDql;
  740.         return $this;
  741.     }
  742.     /**
  743.      * @return Twig_Environment
  744.      */
  745.     public function getTwig()
  746.     {
  747.         return $this->twig;
  748.     }
  749.     /**
  750.      * @return $this
  751.      */
  752.     public function setTwig(Environment $twig)
  753.     {
  754.         $this->twig = $twig;
  755.         return $this;
  756.     }
  757.     /**
  758.      * @return RouterInterface
  759.      */
  760.     public function getRouter()
  761.     {
  762.         return $this->router;
  763.     }
  764.     /**
  765.      * @return $this
  766.      */
  767.     public function setRouter(RouterInterface $router)
  768.     {
  769.         $this->router = $router;
  770.         return $this;
  771.     }
  772.     /**
  773.      * @return int
  774.      */
  775.     public function getIndex()
  776.     {
  777.         return $this->index;
  778.     }
  779.     /**
  780.      * @param int $index
  781.      *
  782.      * @return $this
  783.      */
  784.     public function setIndex($index)
  785.     {
  786.         $this->index = $index;
  787.         return $this;
  788.     }
  789.     /**
  790.      * @return string
  791.      */
  792.     public function getDatatableName()
  793.     {
  794.         return $this->datatableName;
  795.     }
  796.     /**
  797.      * @param string $datatableName
  798.      *
  799.      * @return $this
  800.      */
  801.     public function setDatatableName($datatableName)
  802.     {
  803.         $this->datatableName = $datatableName;
  804.         return $this;
  805.     }
  806.     /**
  807.      * @return string
  808.      */
  809.     public function getEntityClassName()
  810.     {
  811.         return $this->entityClassName;
  812.     }
  813.     /**
  814.      * @param string $entityClassName
  815.      *
  816.      * @return $this
  817.      */
  818.     public function setEntityClassName($entityClassName)
  819.     {
  820.         $this->entityClassName = $entityClassName;
  821.         return $this;
  822.     }
  823.     /**
  824.      * @return array|null
  825.      */
  826.     public function getTypeOfAssociation()
  827.     {
  828.         return $this->typeOfAssociation;
  829.     }
  830.     /**
  831.      * @param array|null $typeOfAssociation
  832.      *
  833.      * @return $this
  834.      */
  835.     public function setTypeOfAssociation($typeOfAssociation)
  836.     {
  837.         $this->typeOfAssociation = $typeOfAssociation;
  838.         return $this;
  839.     }
  840.     /**
  841.      * Add a typeOfAssociation.
  842.      *
  843.      * @param int $typeOfAssociation
  844.      *
  845.      * @return $this
  846.      */
  847.     public function addTypeOfAssociation($typeOfAssociation)
  848.     {
  849.         $this->typeOfAssociation[] = $typeOfAssociation;
  850.         return $this;
  851.     }
  852.     /**
  853.      * @return string|null
  854.      */
  855.     public function getOriginalTypeOfField()
  856.     {
  857.         return $this->originalTypeOfField;
  858.     }
  859.     /**
  860.      * @param string|null $originalTypeOfField
  861.      *
  862.      * @return $this
  863.      */
  864.     public function setOriginalTypeOfField($originalTypeOfField)
  865.     {
  866.         $this->originalTypeOfField = $originalTypeOfField;
  867.         return $this;
  868.     }
  869.     /**
  870.      * @return bool
  871.      */
  872.     public function getSentInResponse()
  873.     {
  874.         return $this->sentInResponse;
  875.     }
  876.     /**
  877.      * @param bool $sentInResponse
  878.      *
  879.      * @return $this
  880.      */
  881.     public function setSentInResponse($sentInResponse)
  882.     {
  883.         $this->sentInResponse = $sentInResponse;
  884.         return $this;
  885.     }
  886. }