TYPO3: Remove validation from ObjectStorage property in model

早过忘川 提交于 2019-12-22 14:57:10

问题


Does anyone knows if it is possible to remove recursive validation from model in extbase TYPO3?

Let's say I have model with following properties:

/**
 * @var string
 * @validate NotEmpty
 */
protected $title;

/**
 * @var string
 * @validate NotEmpty
 */
protected $city;

 /**
 * @lazy
 * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<my/model/classname>
 */
protected $categories;

When passing my object to controller action I want only title and city to be validated. I would like categories not to be validated. Extbase is validating all relations in ObjectStorage recursively - so if my/model/classname has also another ObjectStorage relations they will be validated too.


回答1:


Here is similar thread from TYPO3 forum https://forum.typo3.org/index.php/t/204874/-typo3-mvc-disable-recursive-validation-objectstorage



来源:https://stackoverflow.com/questions/50876032/typo3-remove-validation-from-objectstorage-property-in-model

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!