TYPO3:从模型的ObjectStorage属性中删除验证 [英] TYPO3: Remove validation from ObjectStorage property in model

查看:66
本文介绍了TYPO3:从模型的ObjectStorage属性中删除验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道是否有可能从extbase TYPO3中的模型中删除递归验证吗?

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;

将对象传递给控制器​​操作时,我只希望验证标题和城市.我希望类别不被验证. Extbase递归地验证ObjectStorage中的所有关系-因此,如果my/model/classname也具有另一个ObjectStorage关系,它们也将被验证.

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.

推荐答案

此处是TYPO3论坛

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

这篇关于TYPO3:从模型的ObjectStorage属性中删除验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆