[TYPO3-mvc] get propertyName on objectStorage element - validate objectStorage
Domi
djgarms at gmail.com
Tue Aug 14 21:00:09 CEST 2012
Hi,
as NotEmpty validation doesn't seem to work on ObjectStorage I wrote a
little validator for this reason:
class Tx_Intranet_Validation_Validator_NotEmptyRelationValidator extends
Tx_Extbase_Validation_Validator_AbstractValidator {
/**
* @param Tx_Extbase_Persistence_ObjectStorage $value
*/
public function isValid($value) {
$valueArray = $value->current();
if(empty($valueArray)){
return false;
}
return true;
}
}
How can I receive the "propertyName" inside of this validator? Is there
a function which returns the propertyName of an object storage?
The reason is, that I use the NotEmptyRelationValidator several time and
now I can't get my error messages translated.
Thanks for help!
Cheers Dominic
More information about the TYPO3-project-typo3v4mvc
mailing list