[TYPO3-german] extbase Model validiert nicht?

Marco Behnke marco.behnke at innogames.de
Thu Mar 14 10:29:25 CET 2013


Hallo!

Ich versuche jetzt seit geraumer Zeit vergeblich eine Model Validierung 
zum Laufen zu bringen.

Obwohl ich Validatoren an den Properties definiert habe, läuft der 
Controller durch bis zum Save und scheitert dann mit einer SQL 
Fehlermeldung, obwohl er eigentlich mit einem Validierungsfehler zum 
Formular zurückkehren sollte.

Das sind meine Controller Actions:


/**
   * action new
   *
   * @param Tx_ArArbeitnehmer_Domain_Model_Employee $newEmployee
   * @dontvalidate
   * @return void
   */
public function newAction(Tx_ArArbeitnehmer_Domain_Model_Employee
$newEmployee = NULL) {
	if (empty($newEmployee)) {
		$newEmployee = $this->createEmptyObject();
	}
	$this->view->assign('newEmployee', $newEmployee);
}

/**
   * action create
   *
   * @param Tx_ArArbeitnehmer_Domain_Model_Employee $newEmployee
   * @return void
   */
public function createAction(Tx_ArArbeitnehmer_Domain_Model_Employee
$newEmployee) {
	$this->employeeRepository->add($newEmployee);
	$this->flashMessageContainer->add('Your new Employee was created.');

	$this->redirectToUri('/suche/fuer-arbeitnehmer/ihr-eintrag-vielen-dank.html');
}


Das ist mein Model



class Tx_ArArbeitnehmer_Domain_Model_Employee extends
Tx_Extbase_DomainObject_AbstractEntity {

	/**
	 * Vorname
	 *
	 * @var string
	 * @validate NotEmpty
	 * @validate StringLength(minimum=1)
	 */
	protected $firstname = '';

	/**
	 * Nachname
	 *
	 * @var string
	 * @validate NotEmpty
	 * @validate StringLength(minimum=1)
	 */
	protected $lastname = '';

...
}



Was läuft hier schief?


-- 

Marco Behnke
Software Developer Grepolis

InnoGames GmbH
Harburger Schloßstraße 28 (Channel 4) - 21079 Hamburg - Germany
Tel +49 40 7889335-0

Managing Directors: Hendrik Klindworth, Eike Klindworth, Michael Zillmer
VAT-ID: DE264068907 Amtsgericht Hamburg, HRB 108973

http://www.innogames.commarco.behnke at innogames.de

_______________________________________________
TYPO3-team-extbase mailing list
TYPO3-team-extbase at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-team-extbase




More information about the TYPO3-german mailing list