public function FtpEditFormValidate(Form $form, $values) { $eqUsername = $this->share->findAll()->where('shareType_id = ?', self::shareType_id)->where('NOT folder_id = ?', $values->folder_id)->where('var = ?', $values->username)->fetchAll(); if ($eqUsername) { $form->addError('Toto přihlašovací jméno už existuje, zvolte prosím jiné.'); } }