new ezcInputFormDefinitionElement( ezcInputFormDefinitionElement::REQUIRED, 'int' ), 'email' => new ezcInputFormDefinitionElement( ezcInputFormDefinitionElement::REQUIRED, 'string' ), ); $form = new ezcInputForm( INPUT_GET, $definition ); if ( $form->hasValidData( 'person' ) === false ) { throw new Exception( "No person ID given." ); } if ( $form->hasValidData( 'email' ) === false ) { throw new Exception( "No email address given." ); } $this->id = $form->person; $this->emailString = $form->email; } public function run() { $session = ezcPersistentSessionInstance::get(); $this->person = $session->load( "ezcappContactPerson", $this->id ); $this->email = new ezcappContactEmail(); $this->email->email = $this->emailString; $session->addRelatedObject( $this->person, $this->email ); $session->save( $this->email ); } public function getTemplate() { return "addemail"; } } ?>